My Photo
Powered by TypePad

« The Tradeshow Season | Main | Tell Us What You Need – We're Listening! »

October 13, 2006

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83453a2c069e200d83462837c69e2

Listed below are links to weblogs that reference JavaScripting in Applets - Getting Out of the Sandbox:

» Nightmare: Java Applet and JavaScript from iDeas wHizz
I met the same thing about 2 years ago. And many of my JavaScript calls are restricted so the calls need to be asynchronized. But my JavaScript calls just should be a syncrhronous call. So callbacks [Read More]

Comments

Stéphane Bury

Wow, complicated workaround ! (same as mine to indent code below ;-) )
just to inform you that it exist another way to do that quickly when surrounding the content of your method with java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
See example below:


_ public static void doSpecialWork(String param1) {
_ _ final String fParam1 = param1;
_ _ java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
_ _ _ public Object run() {
_ _ _ _ _ //Put the code of your method here
_ _ _ _ _ ...
_ _ _ _ _ ...
_ _ _ _ _ return "";
_ _ _ }
_ _ }
_ _ );
_ }

You only have to convert all method params into final (see fParam1).
No change in your javascript.

Regards,
SteF.

Stéphane Bury
Developper Analyst
IRIS S.A.
http://www.irislink.com

Mohan Chandran

Hi,
I have created an applet that does the functionality of connecting to remote host using SFTP. When i tried to launch my applet, exception "AccessControlException, access denied" is thrown. I have self signed my jar file. But still same problem persists. How do i solve this issue???

D0nVit0CF

Thank you so much for your workaround! It has worked for me, while the AccessController one couldn't...Don't know why. Anyway, the important thing is that it works and that my job is going on! :) THANK YOU!!! :)

Sebastian Adolph

Hello,

thank you very very much for this example!!!

i have tried both examples...with one strange fact:

When i trigger the action for the first time it is pretty slow until i get a result back.

When i trigger the actions again it work as i would expected...so nearly realtime.

Is this problem familiar to someone?

If yes...any help is very much appreciated!

Kind regards,

Sebastian

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.