Hi,

I need to manually manage the lifecycle of a servlet within a jsp
file.  I can't use <jsp:include> because I need to capture the output
as a string and then throw it into a templating engine.

HttpServletResponse managedResponse = new HttpServletResponse();
MyServlet servlet = new MyServlet();
servlet.init();
servlet.doGet(request, managedResponse);

This doesn't work because new HttpServletResponse(HttpServletResponse
response); requires a response object and if I pass the jsp's response
object then the servlet will be writing directly to the client.

Does Tomcat have anything like the HttpServletResponseProxy? (link below)

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/servlet/response/HttpServletResponseProxy.html

Or is there some other way to create my own HttpServletResponse out of
thin air to pass to the servlet so that I can capture its output and
then use it as a String elsewhere?

Thanks,

Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to