Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Granting an applet read permission

 
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
 
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 ]
 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic