Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet security exception,

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing an applet which will lanuch system default explorer, say IE. but I got security error message.

1. I add coding below to jre/lib/security/java.policy. -- NOT work


2. I create a file , java.policy.applet, in jre/lib/security. The file has the coding below, still NOT work.


3. Could I setup security just for a specific file, say , explorer.exe , only allow a specific applet to just lanuch explorer.exe ?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two general remarks:

1) You should restrict any permissions to the applet in question, e.g.
grant codeBase "http://xxx.yyy.zzz/-" {
permission java.io.FilePermission "<<ALL FILES>>", "execute";
};
Don't know why FilePermission isn't enough in your case - I've never used it.

2) Since this is an applet -so a browser is open already-, can't you just use AppletContext.showDocument to open a new window of the currently active browser?
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

Originally, I use the Eclipse 3.1 to develop applet, when I use applet.showDocument(), it does NOT work.

After your reply, I write a html manually to load applet, it WORKS. so the problem is the Eclipse. Maybe some configurations are wrong.

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet does not have a method called showDocument, but AppletContext does, which you get via Applet.getAppletContext().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic