You should look at the GNU-JSP site, I think that someone there has a
utility that users GNU JSP to generate files for the output. Alternativly
you could hack the generated java code to print somewhere else...
brendan
-----Original Message-----
From: Sergio Socarras [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 11, 1999 2:12 PM
To: [EMAIL PROTECTED]
Subject: Re: Capturing the output from a JSP ...
I've run into the same problem. I'm currently working
on a JSP prototype of our system. Our production
system currently uses NAS 2.11 as our app server and
works very similar to JSP including tag extensions.
One of the tags we implemented is a specialized
include tag that supports the caching of the resulting
template evaluation. Basically, this specialized
include checks the file system for the requested file
(according to keys specified as parameters) and if the
file exist it includes that file, if not, it evaluates
the template and saves the results to the file system.
This caching mechanism is crucial to our system
performance and will soon be used in many areas of our
site. In order for us to move to a JSP model, we need
to be able to buffer/capture the output of a JSP. The
suggestion of using an http call would work but it
adds the http overhead and the parsing to strip out
headers which could be to slow. A better solution
would be to buffer the output of the included JSP so
that it could be written to a file as well as appended
to the rest of the page. But how can you do this using
the RequestDispatcher.include method? I tried creating
my own version of HttpServletResponse object passing a
ByteArrayOutputStream to the contructor of PrintWriter
but that didn't work. I kept getting a Cast exception
since the JSP implementation will cast the
HttpServletResponse object down to the implementation
specific type.
I really need to solve this issue before I can
recommend a JSP solution. Any suggestions would be
appreciated.
Thanks
Sergio
--- John Hawkins <[EMAIL PROTECTED]> wrote:
> Does anyone know a good way of capturing the output
> generated by a JSP so that it can be written to a
> file ? (I basically want to use .JSP's as templates
> to generate a static HTML site).
>
> What I'd like to do is have a wrapper JSP which does
> 2 things,
>
> 1. Redirects out so that it is writing to a file
> rather than returning stuff to the server ...
> 2. jsp:include's another JSP file whose output it
> want's to capture.
>
> I can sort of see a way to do this by providing my
> own JSPWriter, but does anyone have any better ideas
> or any real
> experience of doing something like this ?
>
> I guess the other way is to use something like
> JSPExecutor ....
>
> Any ideas greatfully received,
>
> John.
>
>
=====
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html