This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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...
subject: Viewing HTML source problem..
Similar Threads
Premature EOF while reading from Inputstream
Connections in static methods?
problem with URLConnection
string getting converted to ASCII