Win a copy of AWS Security this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Does anyone use the .java.policy file to give applets permission

 
Rancher
Posts: 3798
35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
I'm having trouble getting a codebase to work for an applet run from a jar file in some browsers: FF3.6.3, Chrome and IE8. The applet works in Older versions of Mozilla.
The applet reads and searches files in a folder and sub folders.

The applet works if I add a permission allowing all files to be read to a grant that doesn't have a codebase (ie for all codebases).
grant {
/* permission java.io.FilePermission "<<ALL FILES>>", "read"; This WORKS!!! Testing ONLY */


I have another entry in the policy file that allows a test applet to read a file. That entry allows ALL of my browsers to read the test file. I've tested by commenting out the entry, get the access denied message and then uncommenting it and having it work.
grant codeBase "file:/D:/JavaDevelopment/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read"; /* For AppletReader Test */
permission java.util.PropertyPermission "*", "read, write";
};


Does anyone have examples of codebase= entries that work with current versions of browsers?


My JRE version info:
Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM

I have posted this question on Sun's site:
http://forums.sun.com/thread.jspa?threadID=5440703

I posted a similiar question here two years ago:
https://coderanch.com/t/259608/Applets/java/Browsers-jre-plugins-applets#1894081
and 5 years
https://coderanch.com/t/259611/Applets/java/does-anyone-java-policy-file#1205624


Thanks,
Norm
 
Sheriff
Posts: 21955
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Applets forum.
 
Do you pee on your compost? Does this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic