Posted By:
champion_boliao
Posted On:
Friday, November 15, 2002 12:38 AM
hi, i am a newbie in java and i just want to implement a very simple application to read the content from a webpage. below is my code try { url = new URL("http://www.nba.com"); System.out.println("getContent...."); InputStream is = url.openStream(); dataInput = new BufferedReader(new InputStreamReader(input)); while ((line = dataInput.readLine()) != null) { buffer.append(line); buffer.append(' '); } System.out.println("ok"); catch (Exception ex) { .... snip.. } the problem is, during runtime, the process stuck at the "getcontent...&
More>>
hi,
i am a newbie in java and i just want to implement a very simple application to read the content from a webpage. below is my code
try {
url = new URL("http://www.nba.com");
System.out.println("getContent....");
InputStream is = url.openStream();
dataInput = new BufferedReader(new InputStreamReader(input));
while ((line = dataInput.readLine()) != null)
{
buffer.append(line);
buffer.append('
');
}
System.out.println("ok");
catch (Exception ex)
{
.... snip..
}
the problem is, during runtime, the process stuck at the "getcontent..." for a while then it reports Connection timed out error.
of course, i run this from a PC with internet connection. something must be wrong.
can someone please enlighten me.
thanks alot.
<<Less