Hi, I load in IE or NS a local HTML file containing a loacl applet (from a JAR file) (local = loaded from the computer's hard disk). Appareantly it is not possible that the applet reads and writes to the local hard disk, although I thought that the applet had the permission to r&w to the host it was loaded from (this mean in this case the local computer). Is this correct or do I make a mistake ? Regards, PS: From the appletviewer it works fine.
Please send us the exact "error message" that you are getting. Sabbir
posted 18 years ago
see below the error I get in the Java Applet Console. It clearly has to do with read/write permissions. I use NS6 and IE6 with the Java PLug-in so they give the same errors. Do I have to foresee in my applet some code to get access (using maybe the netscape.security.* package) ? Here are the errors: Exception occurred during event dispatching: Thx, Stefan java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at com.xmlmill.applet.XMLMill.btnSelect_actionPerformed(XMLMill.java:220) at com.xmlmill.applet.XMLMill$2.actionPerformed(XMLMill.java:161) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
An applet has permission to send and receive against the host it was loaded from, but file I/O is not the same thing as network I/O. Network file access is accomplished by intercepting normal file requests and translating them into network requests, but the sandbox blocks at the file request level, which is why you can't read or write. It might seem too restrictive, but Java always tries to err on the side of security. I suppose that one justification is that by blocking ALL file access, Java ensures that no one can e-mail you a virus applet.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
It's never done THAT before. Explain it to me tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop