File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Without sandboxing? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Without sandboxing?" Watch "Without sandboxing?" New topic
Author

Without sandboxing?

Lin Shen
Ranch Hand

Joined: Oct 08, 2003
Posts: 57
Hi, I am designing a web-based GUI for the client side. I need the applet to access the local hard disk using JFileChooser. Also, I need to integrate CORBA stuff to my applet.

Is it possible to somehow set the java security policy file to allow applet to be able to do these tasks? I am not familar with java security. So could anyone tell me how to set the security file step by step.

Thanks very much.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

It is necessary to digitally sign an applet in order to work around the security limitations. The online book "Advanced Programming for the Java 2 Platform" has a chapter on Signed Applets.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Lin Shen
Ranch Hand

Joined: Oct 08, 2003
Posts: 57
The thing is I want to use a JFileChooser in the applet. But it seems the applet cant even be compiled... :-(

Anybody knows how to solve this problem. Or is there any other way to explore the client's file system?
Lin Shen
Ranch Hand

Joined: Oct 08, 2003
Posts: 57
Hi,

I just tried to run the applet code in eclipse. I used to run Java programs in shell windows under Linux. This is the first time I run an applet in eclipse. And it works and can access the local file system. Why is that? Dosen't applets in eclipse have sandbox constraint?

I am rather confused now. Could anybody explain it?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

You can run an applet as a local application. The most common way to do this is through the JDK tool appletviewer. When an applet is run as a local application, it is NOT sandboxed. Eclipse is probably using appletviewer to run your applet.
 
Don't get me started about those stupid light bulbs.
 
subject: Without sandboxing?
 
Similar Threads
Exception in thread "main" java.security.InvalidKeyException:
reading a URL
Reading files from applets
Reading local files
Reading local files from an applet