with the GNU JSP and I guess in most others, this could work.

<in the beginning of JSP file >
//  replace the out put stream with a byte array stream
ByteArrayOutputStream baout = new ByteArrayOutputStream();
out = new java.io.PrintWriter(baout,true);

<in the end of JSP file.>
//  get the generated output from the byte array stream, and flush it to the
Requesting User Agent
OutputStream outStream = response.getOutputStream();
byte[] cachedOutput = baout.toByteArray();
outStream.write(cachedOutput);
out.flush();
outStream.flush();
// Now the cached Output<cachedOutput> can be written where ever you want.

Harmeet


> Is there any way to capture the output from a JSP page from
> within the
> calling servlet?
>
> I would like to be able to cache the output of the
> dynamically generated
> page on the server and then redirect the web browser to the
> static page.
> >
> Another use would be to build many pages at once and then
> create an index
> page.  We have an in house scripting language that does
> this and it has
> been very useful.
>
> Any help or ideas would be appreciated.
>
> Thanks.
> _______________________________________
> Lead Software Developer
> New England Internet Services
> 482 Congress Street, Suite 402
> Portland, Maine  04101
> v:  207.828.8680   |   f:  207.828.8645

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to