• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doing a URLCOnnection from an Applet

 
Mark Mokris
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to access the text of a web page from a URL connection. Something like:
URL url = new URL("www.yahoo.com");
URLConnection uc = new URLConnection(url);
Well it works fine from a Java standalone application, but not from an applet. Am I running into Applet security? I admit that it doesn't seem to generate an exception in my try/catch block. If I was running into applet security, would I not get an exception? Do I have no hope for this running from an applet?
 
Tim Holloway
Bartender
Posts: 18472
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should get a security exception if the URL you're attempting to connect to is not the same server as the one from which your applet was downloaded. That sandbox rule applies to any type of network connection you attempt using an unsigned applet.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!