xenia27
asked on
Signed Applet
Hi,
First, I am facing this problem of SecurityException. And I realize it's because my applet is not signed applet...correct me if I'm wrong...as I search through the net and I am still not understand well. Now I am wondering how can I write an applet which can be acceptable for different browser? I notice that there are different ways to do this for different browser, such as, Netscape and IE. Is there a way I can make my applet work for all browser? If so, how can I do this? Any example?
Also, I would like to know whether I need to change my codes of "index.html" to make this work.
Finally, not sure why I got this exception "java.security.AccessContr olExceptio n: access denied (java.lang.RuntimePermissi on exitVM)" when I tried to close my applet...what's wrong?
Xenia
First, I am facing this problem of SecurityException. And I realize it's because my applet is not signed applet...correct me if I'm wrong...as I search through the net and I am still not understand well. Now I am wondering how can I write an applet which can be acceptable for different browser? I notice that there are different ways to do this for different browser, such as, Netscape and IE. Is there a way I can make my applet work for all browser? If so, how can I do this? Any example?
Also, I would like to know whether I need to change my codes of "index.html" to make this work.
Finally, not sure why I got this exception "java.security.AccessContr
Xenia
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK...let me make sure my problem...if I got this SecurityException, then, that means I need to sign my applet, right? @@
actually looking at it, it may just be that you are trying to call System.exit() in your applet.
Applets cannot do that.
Applets cannot do that.
ASKER
so if I call some methods which applets cannot do will also cause SecurityException? What if SecurityException with "access denied"??? >"< Getting so confused with all these signed applets and security exception...
here are some of the things unsigned applets cannot do
http://java.sun.com/docs/books/tutorial/applet/practical/security.html
http://java.sun.com/docs/books/tutorial/applet/practical/security.html
the stack trace for the exception is also useful for determining what line caused the error
> I tried to close my applet...what's wrong?
you cannot close applets, they are embedded in the browser page.
they keep running until the page is unloaded.
you cannot close applets, they are embedded in the browser page.
they keep running until the page is unloaded.
>> I tried to close my applet...what's wrong?
Was it running in Appletviewer and you tried to close that?
Was it running in Appletviewer and you tried to close that?
ASKER
OK...I see why I have error message when I tried to close my applet...I cannot close any applets...>"<...
OK...try to figure out what's wrong with SecurityException (access denied)...
OK...try to figure out what's wrong with SecurityException (access denied)...
thats just saying access to that method is denieed.
ASKER
OK....got what's wrong with my codes...>"<...my mistake...
Thanks for your helps~
Thanks for your helps~
What was wrong ;-) ?
If its a Java2 applet then there is one way to sign it for all browsers. Is this the case?
No change needed to html