Can we plugin Signed applet inside JSP
HI,
Can we use an applet jar file that has written to save a file inside the JSP page.If we plugin will it provide the security options.Any way is to solve this particular problem .pls give me solution.
thnx,
login
You are actually getting confused with server side execution and client side execution.
Applet is something that run in client side.
If you see your directory structure you have DBAccess.class in
team/WEB-INF/classes/team/DBAccess.class directory
hope you might be knowing WEB-INF is internal to app server not to the client. so applet can;t find the path for DBAccess.class file.
You have to put that class in team/AppletClass or any other folder where the client applet can access .
Similar Messages
-
Hi,
I am having trouble in configuring my application to run an applet inside my JSP pages.
This is my dir structure:
team/WEB-INF/classes/team/DBAccess.class
team/WEB-INF/lib/ojdbc14.jar
team/AppletClass/MyApplet.class
team/reports/report.jsp
team/main.jsp
The Applet class MyApplet is called from within report.jsp by the following codes of line:
<jsp:plugin type="applet" code = "MyApplet" codebase="../AppletClass/"></jsp:plugin>
The applet works fine if I code it as a stand alone and not using DBAccess class. That is, it appear on my JSP page, however when I use elements from DBAccess class, which is inside WEB-INF/classes/team, it does not load!
I have added D:\team\WEB-INF\classes\team into CLASSPATH variable of my win2K system.
Please help!!! I somehow need this applet class to access DBAccess to query DB and display results on the applet.You are actually getting confused with server side execution and client side execution.
Applet is something that run in client side.
If you see your directory structure you have DBAccess.class in
team/WEB-INF/classes/team/DBAccess.class directory
hope you might be knowing WEB-INF is internal to app server not to the client. so applet can;t find the path for DBAccess.class file.
You have to put that class in team/AppletClass or any other folder where the client applet can access . -
How to use jsp:plugin type="applet" in jsp
Hi ,
I have a JSP File.
How to use jsp:plugin tag in that.
When I specify the file name in code="applet.class" Then it is giving an error saying that It could not find the class.
What is the solution for this.its not working.. it shows exception class not found exception.
i have placed the jsp and applet class in the same folder. but its not working.
jsp file path : OracleSpatial\mypackage\webmap.jsp
applet class : OracleSpatial\mypackage\demoApplet.class
demoApplet class inside package "mypackage".
code inside JSP is :
<jsp:plugin type="applet"
code="mypackage.demoApplet.class" width = "100%" height = "100%" >
</jsp:plugin> -
JRE 1.4.x Plugin - Signed Applets and Weird Behaviour (Policy)
Hello.
I have recently experienced some strange behaviour related to signed applets and policy files in JRE 1.4.2-b28 ( a friend got the same behaviour in a flavour of 1.4.1-xx as well ). Both tests were on Windows 2000 Professional platforms.
Initially my unsigned applet, which attempts socket connections to a server different from the download location, fails with security exceptions ( as expected ). Then I did the following to sign the applet jar and configure my environment
Steps: 1) Import "trusted CA" certificate into ${java.home}/lib/security/cacerts. (JRE home outside the JDK)
2) Signed the jar using jarsigner and a certificate generated from the "trusted CA" (Entrust CA and certificate).
3) Imported the signing certificate into the Java plugin using import in the plugin control panel.
4) Created a new keystore (keytool,jks) and imported the signing certificate into the keystore with alias "developer". The keystore is stored in the user home as .keystore.
5) Created a .java.policy for the user and attaching the keystore in 4) to it. ( also stored in user home ).
6) Used the policy tool to grant socketpermissions to the specific codebase ( testing with file:/C:/test/* initially ) signed by "developer"
After this, when I ran the test page under IE 5.5SP2 and Netscape 7.1 it worked without any security exception. Ditto for using the appletviewer and the policy file I created for the user.
The weird part occurred when I removed the policy entry from the user policy file. After doing this, Netscape and IE still allow the applet to execute - somehow remembering that it was granted permissions at some point. The appletviewer does not allow it to execute, generating security exceptions.
It appears the old policy is being cached somewhere, but I cannot find where. If I replace the applet jar with an unsigned version it does fail in IE and Netscape. I tried cleaning the plugin cache and removing the "deployment.certs" files related to the users but still get the same behaviour.
Does anyone know where the old policy information is being stored ? Does anyone know how to revoke the permissions so that I am restored to my original base environment ( no permissions for "designer" signed applets ) ? Would attempting to utilize the AccessController.doPriveleged( xxxx ) operations in JDK 1.4 avoid all of this confusion with policy files, keystores and certificate storage ? After all the messing about I would like a zero-footprint alternative ( or minimzed footprint anyway ).
Any ideas would be most welcome.
Regards,
James.Hello Again.
I am either enlightened or confused at this point. I found that as long as all of my related Jars are signed ( even by self-signed certificates ) I am granted SocketPermissions for calls outside of the originating server. Unsigned code is refused, but even when the Jars were signed using a self-signed certificate the Socket calls were allowed.
Am I experiencing the appropriate behaviour in this case ( which would mean not having to utilize policy files to distribute an applet that uses calls to arbitrary servers - e.g. JavaMail ) or am I suffering from something damaged in my environment ?
It has been a long time since I played with signed applets and I am having difficulty determining what operations require policy file entries/AccessController.doPrivileged() calls and which are granted when a user elects to trust a signed applet without policy.
Any assistance in clearing up my confusion would be appreciated.
Regards,
James. -
Can i call signed applet from jsf page in sun studio creator
Hello javites,
I want to know whether i can call signed applet from jsf page in sun studio creator. If possible, how do i go about it.
Thanks.This tutorial may help:
http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/applet.html?feed=DSC -
Can i write Html code inside JSP method???
hi i am newbie to jsp and servlets. i am working on a project where i have to use same html code for two conditions in jsp. my question is can i write that html code inside any method in jsp?? and then can i call that method within that if and else scope. can anyone help me with this??
I don't think that does what you think it does.
<%!
void renderStateSelect(String default) { %>Creates a method with that signature and an open brace...
<select name="state"> puts:
out.println("<select name=\"state\">");
into the _jspService method
<%!
// logic to loop thru states
%>Puts the loop logic after the brace opening up the method renderStateSelect
</select>puts
out.println("</select>");
in the _jspService method
<%!
%>Closes the renderStateSelect method.
So if I do this:
<html>
<body>
<%!
void renderStateSelect(String def) { %>
<select name="state">
<%!
// logic to loop thru states
%>
</select>
<%!
%>
Hello<br/>
<% renderStateSelect("none"); %>
Everybody
</body>
</html>The html output is:
<html>
<body>
<select name="state">
</select>
Hello<br/>
Everybody
</body>
</html> The 'renderStateSelect method does not render the state select. The _jspService method does, in place where the HTML is written in the JSP file. As another look, the translated servlet looks like this:
package org.apache.jsp;
public final class IsThisOk_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
void renderStateSelect(String def) {
// logic to loop thru states
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
try {
out.write("<html>\r\n<body>\r\n");
out.write("<select name=\"state\">\r\n");
out.write("</select>\r\n");
out.write(" \r\nHello<br/>\r\n");
renderStateSelect("none");
out.write("\r\nEverybody\r\n</body>\r\n</html>\r\n ");
}See. Any plain HTML code you put outside of the <%! %> tags is converted to out.printlns inside the _jspService method (in place where they occured in the JSP, not where the method you want to do the rendering is called...)
So unless I completely misunderstood your intent here, this apprach does not work. -
Hello,
I'm having trouble trying to get my signed applet to work. Here's my situation:
I've created a signed .jar file that relies on classes in another .jar file. The second .jar file comes from a 3rd party and is signed by them. I'm using IE. When trying to access the applet, I get a security dialogue box that prompts me if I want to trust the signed applet signed by me. I click yes and get an error in the java console window
java.lang.NoClassDefFoundError: netscape/security/AppletSecurityException
at java.lang.Class.forName0(Native Method)
I'm assuming this is because of the 3rd pary .jar file I'm trying to use. I was not prompted to trust this .jar file. Should I have been? i have listed this other .jar file in the html file as one of the archives. Should I be using .cab files instead? What is the proper way to construct the html file when using multiple signed .jar files (signed by different parties) in conjunction with IE?
I've gotten another simple signed applet in the form of a .jar file to work with IE just fine. But, it didn't rely on a signed 3rd part .jar file.
Any help is greatly appreciated.
thanks!
-jeffThe ClassNotFoundException for Netscape should be handled in a catch block when running in IE's native JVM. This is a bug in the code.
You can run multiple signed applets in IE. There's no special HTML syntax to do so, just multiple applet tags. Generally, it will prompt you to accept permissions for each signed codebase.
Eimhin -
Signed applet can't read image file..
Hello
My English ability is very poor.. sorry
I make a signed applet
and I open Internet Exploere
I connect to my web page
when I connect to my web page
my signed applet upload "c:\blahbalh...\image.gif" automatically
but It's not work
java.security.AccessControlException: access denied (java.io.FilePermission C:\DOCUME~1\krict\LOCALS~1\Temp\Hnc\BinData\EMB00000cac2143.jpg read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at EchoApplet.onSendData(EchoApplet.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
signed applet can't not read file..
how can I solve my problem?Trace please.
http://forum.java.sun.com/thread.jspa?threadID=656028
Maybe some relevant code
Signing applets:
http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
second post and reply 18 for the java class file using doprivileged -
How can I use a applet in a JSP file?
hi
I failed to use applet in a jsp file.My workspace is a BC4J type. I put the applet's source file in business component project.the jsp is in JSP project.
The jsp file calls applet by <jsp:plugin></jsp:plugin> style.
The error is can't find the applet class.
why? Thank someone for give me help.Actually using jsp applet tags does not mean that it is taking care of that the classes are available. It simply renders the Applet tag tothe JSP page. If e.g. teh codebase is specified as /java/, then there should be a mapping to the Java class location with thename of /java/. If codebase is not provided, then the Java class must be in the classpath of the JSp servlet.
Frank -
Can a signed applet run classes from disk?
Hi all,
I have a signed applet jar and a signed jar file somewhere on disk (I can ensure the jar file is available on client's machine before i run the applet). My applet doesn't let me have file io access from the classes in the jar file on disk. It gives the following exception:
java.security.AccessControlException: access denied (java.io.FilePermission C:\test.jar read)
However I do have file io access from classes in the applet jar itself. Both the jar files are signed.
Is there any way to get around the plug-in security in this case?
Using installed extension (jar/lib/ext) is not an option, unfortunately.
Any help will be appreciated.
-JasIs it not the same problem of JavaScript which calls Java ?
Harmemejer posted : http://forum.java.sun.com/thread.jsp?forum=63&thread=524815 (second post) ???
Hope it helps
Rafax. -
How to deploy a JSP with jsp:plugin with applet type?
Hi,
I am a new comer for JSP and when to try to a simple JSP with plugin for applet. Following is part of my JSP script:
<jsp:plugin type="applet" code="DigitalClock" align="center" height="25" width="300"
>
<jsp:params>
<jsp:param name="language" value="<%=request.getLocale().getLanguage()%>" />
<jsp:param name="country" value="<%=request.getLocale().getCountry()%>" />
<jsp:param name="bgcolor" value="FFFFFF" />
<jsp:param name="fgcolor" value="CC0066" />
</jsp:params>
<jsp:fallback>
<p>Unable to start plugin.</p>
</jsp:fallback>
</jsp:plugin>
===========
And Java plugin tell me that can't find DigitalClock class. I want to ask how to deply this JSP using deploytool.
Thanks,
WiseHi
It should be in such a way,
The Jsp:param is similar to PARAM used in Applet.
<jsp:plugin type="applet"
code="MyApplet.class"
width="475" height="350"
<jsp:params>
<jsp:param name = "PARAM1" value="VALUE1" />
</jsp:params>
</jsp:plugin>
jsp:fallback Element
It provides alternate text to browsers that do not Support OBJECT or EMBED. You can use this element in the same way as you provide alternate text in your applet.
<jsp:fallback>
<b> Error: This example requires java </b>
</jsp:fallback>
</jsp:plugin>
I hope this will help you.
Thanks
Bakrudeen
Technical Support Engineer
Sun MicroSystems Inc, India -
Security problem when signed applet dynamically load plugins
Hi!
I have one problem : "security problem when signed applet dynamically load plugins"
This is the scenario:
the main program [app.jar]
. contain applet and shared library (interface & implement of common class)
. it is signed and run normally on browser
. it can draw image loaded from other URL [ex] http://bp1.blogger.com/image.jpg
. the image loader is in the shared library
. dynamically load amazon.jar through URLClassLoader and reflection
the plugin [amazon.jar]
. search amazon product [ex] Harry Potter book
. draw image on applet
. use image loader from shared library, BUT CANNOT LOAD IMAGE
The question: "Why it cannot load image, because the image loader is in the shared library which has been signed and working?" I tried to sign the amazon.jar too, but it did not work.
Your reply would be very helpful. Thank you.
Sovannhello. i have create a signed applet for A.jar. A.jar include two package B and C. the main applet class is within B.
B need some classes in C to run the applet. but i got the error that class in package c are not found.
what shall i do? -
I can't run signed Java Applets
HI
I have a java applet where I need to have acces to a local file, but I can't get IE to run the applet. (IE do not come with the Secutiy Warning window.)
From the homepage, I run the applet via:
<applet name=read_file code="read_file.class" width="0" height="0">
<script language="JavaScript">
document.read_file.file_read();
</script>
And the java code is:
import java.applet.*;
import java.awt.*;
import java.io.*;
public class read_file extends Applet{
public char[][] ip;
public int counter;
public String te="dette er en java test";
public void init() {
public void file_read() {
String str;
counter =0;
try {
BufferedReader in = new BufferedReader(new FileReader("c:\test\config.txt"));
while ((str = in.readLine()) != null){
ip[counter] = str.toCharArray();
counter++;
in.close();
} catch(IOException e) {
public void test() {
I have signed the cab file with:
"C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\signcode.exe" -j "C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\JAVASIGN.DLL" -jp High -v hjl.pvk -spc hjl.spc -n "oil" -i "www.vedikke endnu-.dk" "C:\Documents and Settings\rbn\Desktop\UIp\hjemmeside\read_file.cab"
and maket the cab fil with:
"C:\Documents and Settings\rbn\Desktop\UIp\cab\BIN\MAKECAB.EXE" "C:\Documents and Settings\rbn\Desktop\UIp\java\read_file.class" "C:\Documents and Settings\rbn\Desktop\UIp\hjemmeside\read_file.cab"
What do I need to different ?I see no reason why you want to make this applet for the msjvm, here is how you do it with the sun sdk:
Signing applets:
http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
second post and last post for the java class file
http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
4th post explaining how to set up your own policy with your own keystore
(my copy and paste fingers are really getting tired now, copyd and pasted this
for about a 100 times now)
Notice some differences in the html code of the examples (they don't use the applet tag)
If you're aiming for the msjvm because you don't want any support form MS in
the near future and want to delever a legacy unsupported unmaintainable applet
than I have to ask you how you compiled the applet. If you used the SUN sdk
then are you aware that the msjvm cannot handle java version higher than 1.1?
So you have to compile it like this: javac -source 1.3 -target 1.1 ....
Your html file seems to be missng the cabbase value so how do you expect
IE to find the cab file? -
How can I pass a variable to an applet in JSP?
I want to invoke an Applet in JSP and pass a variable( ie. port) to the Applet. I do as follows:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=port>
</applet>
in Applet1.java , I use getParameter("port1"),yet I got character string "port" ,not the value of port(i.e. 100).
How can I get 100 not "port"? Thanks!!!Assuming that port is a variable defined and initailized in the jsp:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=<%= port %>>
</applet> -
I am unable to view videos. I keep getting blocked plugin signs. How can I fix this problem?
What if the latest plugin is the problem? I installed the latest version and now it does not work.
Maybe you are looking for
-
Column for Marketing Attributes
Whenever I search for a business partner, i get a list of business partner below. I want a fucntionality where if a search a business partner by entering a business partner. In the result, i need a functionality where i all the marketing attributes a
-
What is the meaning of the 'C within a square' symbol next to various albums? The thought it meant clean version, but I don't see cooresponding 'E' (explicit) albums.
-
Reprocessing Synchronous calls from XI
Is there any way to reprocess synchronous calls from XI when they fail. Means a webService calling RFC through XI , in case R/3 is down then that case message should be persisted in XI and the error message(R/3 down)needs to be sent to webService. La
-
Help SQL syntex...
hi all, i'm want bellow result by use SQL sytex. A B A-B-C A-BC -->select * from A ,B where A.A=B.B ; A B A results: A-B-C=A-BC,A B=A etc... A column and B column is'nt equal.so according to use SQL syntex which is INSTR,SUBSTR etc... , i'm want to h
-
I'm trying to log in to the Story Desktop application. When I hit the Sign In button, I get a white window opening up, which I assume should be the login screen where I enter my email and password. But that box remains white with a spinning clock,