tags:

views:

42

answers:

2

I'm not a java guy and I got some JSP code from a friend for testing purposes. All succes/faliure information is being output to browser, but the problem is - I'm not the one who is making the request. So

Is there any simple way to copy/redirect default output of the JSP to a file on server but still finish the request?

A: 

Create a JSP custom body tag that can capture the contents of it's body to the file after the body is processed. You would dispatch to a wrapper jsp with the capture tag and the real jsp is passed as a parameter.

Example:

<mytags:capture filename="file.html">

<jsp:include page="<%=request.getParameter("realpage")%>"/>

</mytags:capture>

Checkout online tag library :

http://www.servletsuite.com/jsp.htm

On this library I found "Postprocessor taglib" this had getContent & getContentString which can be used in you case.

http://www.servletsuite.com/servlets/postproctag.htm

YoK
This sounds like what I asked for, but... I'm not a java guy as I said, and I don't get it. I'll accept Your answer if people upvote it or if I manage to understand what I have to do ;)
naugtur
I have added link to JSP tag library. You Create similar or use this tag library in your JSP.
YoK
+1  A: 

I think that you can use the standard code:

System.out.println("message...");

which usually prints to catalina.out in Tomcat application server.

Impiastro
Ok, this helped. :)
naugtur