Ok now I have started coding but facing a problem.
|
PHP Code:
|
try {
URL url = new URL("url_to_file/test.txt");
URLConnection urlconnection = url.openConnection();
long l = urlconnection.getContentLength();
fTextArea.append("Content Length = " + l);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = in.readLine()) != null)
{
fTextArea.append("\n"+line);
}
in.close();
} catch (Exception e) {
fTextArea.append(e);
return;
}
|
When I run this code locally it works fine but when run in browser it shows security exception
java.security.AccessControlException: access denied (java.net.SocketPermission site:80 connect,resolve)
What should I do to resolve this error. Sorry for being such a noob but do not have much info about this.