Thanks for the reply...
I used the following code to get the contents of the link
URL url = new URL("http://www.google.com");
HttpURLConnection uc = (HttpURLConnection) url.openConnection();
uc.setRequestProperty("User-Agent", "");
// Read all the text returned by the server
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String str;
while ((str = in.readLine()) != null) {
// str is one line of text; readLine() strips the newline character(s)
System.out.println(str);
}
in.close();
But,it is giving error java.net.UnknownHostException: www.google.com
I am working on the LAN.If i exceute the same code outside LAN its working..What could be wrong?
Thanks,