This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Applets and the fly likes does anyone use the .java.policy file? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Applets
Reply Bookmark "does anyone use the .java.policy file?" Watch "does anyone use the .java.policy file?" New topic
Author

does anyone use the .java.policy file?

Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 681
Hi,
Am I the only one using .java.policy file to allow an applet to read files on my local disks? I'm able to have an applet in Firefox read/write a file, but in IE7 it fails.

Any recommendations on how to debug/trace it so I can get it to work?

Thanks,
Norm
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35439
    
    9
The first step would be to make sure that the policy file that contains your modifications is being used at all. Maybe create a new Permission class, require that in the applet, but don't add it to the file. Then the applet should fail.

Or comment out some of the permissions that were in the file before, and make sure that the applet fails where those are required.

Once you know the file is being used you can work on the individual permission you actually want to add. I seem to recall seeing a discussion recently that implied different browsers didn't recognize quite the same policy file syntax (which doesn't make much sense, as it's the JVM doing the interpreting, but it was being claimed).


Android appsImageJ pluginsJava web charts
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 681
Thanks for the response.
I've asked questions on this problem from several points of view. You probably saw some of them.
The .java.policy file has been working for years with some browsers. It works for IE7 if the file to be writtten is fully referenced, but not with the - or * wildcard.
It seems that IE7 must have a different Security Manager.

The only techniques I've seen are what I call the shotgun method, try every possible combination until you find the one that works. No way to trace the Security manager to see what it needs or what it doesn't like.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: does anyone use the .java.policy file?
 
Similar Threads
How to create a trusted applet ?
How can I get an applet to write to a client file
Copy to clipboard not allowed?
Granting SocketPermission in an applet
Blocking system props from Applets ...?