I am trying to capture a snapshot of the HTML of a page at a certain stage. If I call the
struts action class from a browser, this page comes up perfectly with the correct values where the
JSP write tags resolved. When I try calling this struts action class from inside a different action class and capture the HTML in a buffer, the values that should be in the request object are not so the write tags produce nothing. I have tried calling this code snippet from a different JSP where the correct formbeans were in the request object and it still didn't produce the values. Here is my code snippet:
StringBuffer fullReportPath = new StringBuffer();
fullReportPath.append("http://devServer1:9080/ofroiWeb/FinalForm.do");
URL url = new URL(fullReportPath.toString());
BufferedReader br = null;
br = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuffer buffer = new StringBuffer();
String str;
while ((str = br.readLine()) != null) {
buffer.append(str);
}
// Close the input stream and return bytes
br.close();
I have been thinking about a workaround, where I put the formbean in the session and then change the JSP to look in the session for it rather than the request object, but I don't want to do this unless I have to.
Thanks,
Alan