Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Capturing the HTML returned by the web server


Message #1 by "Ian Andrew Jones" <iajones@b...> on Fri, 21 Feb 2003 14:22:06
you can use the following:

URL url=new URL(<the address of the page you want>);
InputStream is=url.openConnection().getInputStream();

then, by reading the input stream you'll get the html returned

----- Original Message -----
From: "Ian Andrew Jones" <iajones@b...>
To: "Pro_JavaServer_Pages" <pro_jsp@p...>
Sent: Friday, February 21, 2003 2:22 PM
Subject: [pro_jsp] Capturing the HTML returned by the web server


> I have a hidden Java Applet on the page, acting as an interface between
> JavaScript on the client and Java classes on the server.
> I need to refresh part of the screen, so I call a method within the Applet
> using JavaScript, passing it the co-ordinates of the page to refresh, the
> size of the area to refresh and the JSP file responsible for that part of
> the screen.
> I need to know how to call a JSP page on the server and then capture the
> returned HTML as a string. I can then append the string into the HTML by
> calling a JavaScript function from within the Applet, giving the
> appearance of an on-demand refresh.
> I have been looking at the java.net.HttpURLConnection class but can't seem
> to figure it out.
> NOTE: Frames, Layers, IFrames et cetera are not an option.


  Return to Index