Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File IO with Applets

Status
Not open for further replies.

kilando

Programmer
May 29, 2003
12
CA
Hey folks,

I'm trying to write an applet that will display text depending on what is written on anotehr website (a sports ticker)

I get the following error when I try to run the program:

java.security.AccessControllException: access denied (java.net.SocketPermission resolve)

The code that is throwing the error is this:
Code:
String site = "[URL unfurl="true"]http://www.theWebsite.html";[/URL]
URL target = new URL(site);
BufferedReader br = new BufferedReader(new InputStreamReader(target.openStream()));

This works fine when run from an application, is there something about Applets that don't let you use BufferedReader? Any help/suggestions?

Thanks.
 
Last time I wrote an applet it was a security violation to let it open local files. That essentially means I could write an applet that I make you load that opens your hard drive and starts deleting files or retrieving secure info etc etc.

There are ways around this but if I remember it was not pretty..

The better way to handle this is to have the applet communicate with a webserver that retrieves the data for you.
 
the applet is not signed? If it's not, it just can connect to the server from it was downloaded.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top