File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Viewing HTML source problem.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Viewing HTML source problem.." Watch "Viewing HTML source problem.." New topic

Viewing HTML source problem..

harish raghavan

Joined: Jan 18, 2006
Posts: 8
Hello people...i have a doubt...i have done a program on storing the HTML source of a system uses Direct IP and i got the output...but when i execute in LAN i get the exception Source genration error...i found the problem is due to proxy connection...can u ppl let me know how to setup proxy and make this code work...please modify this code and send me so that it works on a LAN environment...ASAP please

public int source(String linkpass)
StringBuffer strBuf = new StringBuffer();
URL page;
InputStreamReader in;
BufferedReader data;
String line;
URLConnection conn = null;
page = new URL(linkpass);
conn = page.openConnection();
in = new InputStreamReader(conn.getInputStream());
data = new BufferedReader(in);
while ((line = data.readLine()) != null)
strBuf.append(line + "\n");
catch(Exception e)
System.out.println("Source generation error");

Code in Binaries...
I agree. Here's the link:
subject: Viewing HTML source problem..
It's not a secret anymore!