View Single Post
  #4 (permalink)  
Old 07-21-2008, 06:29 PM
nitinmukesh nitinmukesh is offline
Member
 
Join Date: Jul 2008
Posts: 3
Rep Power: 0
nitinmukesh is on a distinguished road
Default
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.
Reply With Quote