wood burning stoves 2.0*
The moose likes Applets and the fly likes WebPage can't run applet as signed after another signed applet is disabled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "WebPage can Watch "WebPage can New topic
Author

WebPage can't run applet as signed after another signed applet is disabled

Se Koan
Greenhorn

Joined: May 05, 2008
Posts: 7
Hello,

My web page runs a signed applet when loaded. After a user clicks a button on that page it makes the applet control Visible='false' and makes another signed applet Visible='true'.

When the first applet initially loads with the web page I am asked for permission to run signed applet but when the second one is loaded I don't see such security dialog box and I think that's why it don't work properly (it starts as a simple applet and not signed one).

Is there any way to force that security dialog box on the second applet or to completely unload the first one (with JVM together?)? Maybe JVM is to slow to unload the first signed applet?
Everything is ok if I comment out the code for the first applet and make the second applet be one that first loads on my webpage.

Thanks.
Andrew Thompson
Ranch Hand

Joined: Aug 05, 2010
Posts: 77
    
    5
Applet visibility is separate from applet loading. Both applets are loaded as soon as the page is loaded, and that is when the JRE will prompt for permissions.


Andrew Thompson
http://pscode.org/
Se Koan
Greenhorn

Joined: May 05, 2008
Posts: 7
Thank you!!

I am writing the webpage using asp.net. Do you think the second applet will work if I remove the second applet's html code from the .aspx page and load this code for the second applet from codebehind (that is create this html control on aspx page). Do I need to (somehow) remove the code for the first applet element from the aspx page?
Andrew Thompson
Ranch Hand

Joined: Aug 05, 2010
Posts: 77
    
    5
It sounds to me as though the page is working at the moment, just, not the way you'd like. As far as that goes, it is 'tough biccies', since any hack that you come up with to make it work the way you expect is likely to break with the next version of Java or the browser.

The solution? Redesign your app.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

A possible solution would be to make it into one huge app. If you put it into one program, you would solve your problems.

John Price


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
john price wrote:A possible solution would be to make it into one huge app.

Indeed. Using a CardLayout would be a good approach for this.
Se Koan
Greenhorn

Joined: May 05, 2008
Posts: 7
Thanks, good suggestions but there's a problem. Initially I made one applet. At first it loasds with page and after the user allows the applet to tun as signed the applet performs some actions and writes data to temp file. Then athe user presses a button on the webpage and it changes the css class of the applet to move it to other position and resizes it, additionally it passes a parameter to the applet to say that it now needs to read temp file and display the data. Changing the css class of this applet makes it reload but when it reloads it acts not as a signed applet, seems like it can't read the file and thus can't display the data and that means possibly I must force the signed applet security dialog box to show up again or keep the applet from reloading but how to change it's position/size on the aspx page then...?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I can't say I fully understand what you're trying to do, but it sounds like having just a single applet would take care of most of the issues you describe.
Se Koan
Greenhorn

Joined: May 05, 2008
Posts: 7
Tim Moores wrote:I can't say I fully understand what you're trying to do, but it sounds like having just a single applet would take care of most of the issues you describe.


Basically, this: I don't think I can use one signle applet because I need the applet to be reloacated on the webpage to display the data. For that I change the css class of the applet and when the applet is moved to other position on the page it reloads but after this it can't work as signed applet.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Maybe you can redesign the page so that the applet does not need to move. That would be a confusing (to the user) thing to do anyway.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebPage can't run applet as signed after another signed applet is disabled