/*
* Applet.java
*
* Created on 14 October 2004, 10:36
*/
/**
*
* @author Default
*/
import java.net.*;
import java.io.*;
public class Applet extends java.applet.Applet {
public void init() {
try{
URL yahoo = new URL("http:/&#<span class="java-number">47</span>;www.yahoo.com&#<span class="java-number">47</span>;"</span>);
System.out.println(yahoo.getContent());
}
<span class="java-keyword">catch</span> (MalformedURLException e){}
<span class="java-keyword">catch</span> (IOException e){}
}
}
</pre></div><!--ENDSCRIPT-->
but I get a access denied error. After a bit of reading I know it has something to with the Security manager not allowing me to access URL not on my localhost. Is there anyway of bypassing this?
All I need to do is be able to read the HTML code of a webpage.
Any help would be appreciated.
Talib
[java] URL access denied
Hi
I wrote the following code (as a start):
If this applet is served from a normal web server, you could set up a gateway program that the applet could access to get to the URL you want. If not, then I think you have to digitally sign your applet and ask for permission to access other resources. I have never done it, so I don't know the specifics.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement