Forums Register Login

Granting an applet read permission

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1320 times.
Similar Threads
Exception when start rmi server
java.security. Error
JAAS and Policy files problems
Signed Applet
can Applets read/write to Access?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:12:25.