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

Granting an applet read permission

 
Nick James
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can anybody tell me how to successfully grant my applet read permission so it can read graphics files. I`ve read many a tutorial from sun, looked at many webpages but for the life of me I cannot get my applet up and running.

It works fine in the applet viewer but I get a java.security.AccessControlException when I run it using a browser.

Please help. I`ve been having this problem for weeks now and I`m so frustrated.

Nick
 
Korol Bloom
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,

do you write a program for the Sun-Plugin specificly (JRE >= 1.2) or for Java 1.1.x? In the first case, you have to
a) sign your applet,
b) include a SecurityManager into your Code.
The 2nd case is more complicated, because M$VM and Sun VM (and probably Symantec VM of Netscape 4) use different Security mechanisms.

a)
I found these lines on the web and don't know, how they work, but they work.


b)
Include this into any class. Before you do your local file access, call isPrivileged(). This method returns true, if the user granted file access (that means, he accepted the applet's certificate).

hope, this helps.

,korol
[ August 29, 2004: Message edited by: Korol Bloom ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic