Getting Text from a URL
try {
// Create a URL for the desired page
URL url = new URL("http://hostname:80/index.html");
// Read all the text returned by the server
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.readLine()) != null) {
// str is one line of text; readLine() strips the newline character(s)
}
in.close();
} catch (MalformedURLException e) {
} catch (IOException e) {
}
this code gives us the html formatted text but whr in i want the acctual text
how do i get it plz reply to me as soon as possible to afreaz@gmail.com
I tried this and it only works if the URL is on the same domain as the JSP page. Does anyone know a workaround for that problem?
Thank you!