The moose likes Applets and the fly likes BEGGING for a Simple Answer to Applet Security Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "BEGGING for a Simple Answer to Applet Security Issue" Watch "BEGGING for a Simple Answer to Applet Security Issue" New topic

BEGGING for a Simple Answer to Applet Security Issue

Kevin Brennan

Joined: Oct 23, 2003
Posts: 27
I have a program that searches the local hard disk on a PC for certain files and, if they are present, writes those file names to another file on the local disk. (I am a Java rookie and this program would not have evolved without the patient and able assistance of ranch member Marc Weber). When running from the console, it has no user interface and works fabulously.
I have converted this to an applet that compiles without error. When I call this applet from an HTML page, IE 6 complains about a script or ActiveX control trying to run. If I accept this challenge, the status bar indicates that the Applet has started, but nothing else happens.
I have read through many posts, Java docs and secondary references that I think are relevant to this issue, but the best of them talk only about theory, and none talk about answers to this question:

*HOW* (meaing what steps do I take) do I prepare this applet so that it will run through an HTML page hosted by any browser on a Mac and PC. Since I am not writing a virus or any other evil-doing code, I can confidently assume the responsibility of teaching the users to accept any challenges they face.

Thanks to all who can contribute to what I hope is a straightforward problem.
Kristin Stromberg
Ranch Hand

Joined: May 17, 2005
Posts: 91
My guess is that you're trying to do something (read/write files on the user's local system) that is just not allowed.

See this page for more info.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

I'm sorry to say that the answer is not simple, but there is indeed an answer. If you're willing to require all users to use the Java plug-in, it lies in part III of this document, the Java Plug-in Developer's Guide. Read it, look at the alternatives, and have your checkbook ready.

If you want to try to support the old Microsoft JVM as well and old versions of Netscape, well, God help you.

Can you explain why you're doing this? Maybe there's a better solution than using an applet.

[Jess in Action][AskingGoodQuestions]
Kevin Brennan

Joined: Oct 23, 2003
Posts: 27
Kristen and Ernest,
Thank you for your speedy and helpful references.
As background for Ernest, my organization wants to look for the existence of a company file on its computers. Both Macs and PCs are supported, and it would be highly convenient to do this through an HTML page. I suppose that if I need to handle each platform differently, I could. For instance, I thnk the browsers on the Mac are much more standard and consistent; maybe I can focus on this solution for Macs and try something different for the PCs.
Does limiting it to Macs help?
I was given to understand that the Javs Browser Plug-in would always offer the user the chance to run an applet even if it was unsigned. Since this is not a probelm in my organization, why do I have to fool with it at all?
[ July 13, 2005: Message edited by: Kevin Brennan ]
subject: BEGGING for a Simple Answer to Applet Security Issue
Similar Threads
How to invoke a java class which is not an applet from the html page?
HTML wont run Applet
Writing to a file
JDBC and Linux
"Applet not initiated" in Tomcat 3.3