tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Laffey <>
Subject Re: writing jsp output to a file
Date Mon, 13 Nov 2000 19:07:13 GMT
On Mon, 13 Nov 2000, John Ellis wrote:

> All you need to do is create a virtual browser:
> URL pageYouWant = new URL(completeRequestString);
> InputStream in = pageYouWant.openStream();
> // burn off the header from in, then write the rest to a file...
> This will all be done, of course, in a completely seperate JVM than your
> Tomcat JVM.
> It sounds like an ineresting application of jsp.

What if you compile your ordinary JSP into a servlet (by executing it
normallY). Then go to the compiled servlet and replace "out" with a normal
DataOutputStream or FileWriter.

Remember that your JSPs all get converted to servlets, which encapsulate
the HTML portions of the JSP page into out.print() statements.

If you had to do this a lot I bet you could hack a copy of Tomcat or
GNUJSP pretty easily so that it did this be default.

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
With no walls or fences on the Internet, who needs Windows or Gates?

View raw message