>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,=20
>
>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 would write a jsp page operating on a list of relative urls +
prefix (http://localhost).
This jsp pages just uses HTTP GET, get an input stream from an url
connection, open an output stream to a local file and just copy
the data. No need for own JspWriter or redirecting out.
You can find examples of reading from an URL at a lot of
places, 2 examples are in the GNUJSP cvs package:
testsuite/main.jsp: uses that to get the output of jsp pages
and comparing it with expected output
JSP10Servlet.java uses it to implement jsp:include on JSDK 2.0.
>
>Any ideas greatfully received,
>
>John.
> =20
>
>------=_NextPart_000_000B_01BF0B90.F1622340--
>
>===========================================================================
>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
Ciao,
Carsten Heyl
Carsten Heyl [EMAIL PROTECTED]
NADS - Solutions on Nets http://www.nads.de/
NADS GmbH http://www.pixelboxx.de/
Hildebrandtstr. 4E Tel.: +49 211 933 02-90
D-40215 Duesseldorf Fax.: +49 211 933 02-93
===========================================================================
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