Link to home
Start Free TrialLog in
Avatar of manne
manne

asked on

Getting a WWW-page

I'm working with a program that uses the following lines to get a www-page (form Visual J++ sourcebook). When I run
from within J++ it works, but with a browser the following
run-time error occurs "security. Couldn't connect to www.foo.foo with orgin from file". Whats up? I've also used
JDK, but I get the same result.

InputStream conx;
DataInputStream text;
String line;
StringBuffer b=new StringBuffer();

try{
                   conx=this.myUrl.openStream();
text=new DataInputStream(new BufferedInputStream(conx));
while ((line=text.readLine())!=null){
      b.append(line+"\n");
      }
}
catch(Exception e){
 showStatus ("Error reading file: "+ e.getMessage());
}
ASKER CERTIFIED SOLUTION
Avatar of gadio
gadio

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial