[WEB SECURITY] Run JSP file from Servlet

shadi Aljawarneh shadi.aljawarneh at durham.ac.uk
Tue Jun 13 10:16:40 EDT 2006


Hi All,
Please I need some help in this problem if you don't mind :
Problem is: I need to run this JSP serverside in the same session 
context that the client is using for his browsing session. The JSP 
should be handled by the same Tomcat process that handles the clients 
complete session.

Therefor the


HttpServletRequest.getRequestDispatcher( "jsp_file.jsp" ).include( 
HttpServletRequest, HttpServletResponse )

or

HttpServletRequest.getRequestDispatcher( "jsp_file.jsp" ).forward( 
HttpServletRequest, HttpServletResponse )


popped into my mind. Problem is: This Dispatcher needs another 
HttpServletResponse
object, because the result of this should not be sent to the clients 
browser. I want to get the response stream as String to use it as SQL 
statement.


Cloning is not possible and a wrapper doesn't work, because the interfaced
methods (when overwritten) cannot prevent the submit of the rendered stream
to the client browser inside the include()-method.


Has anyone an idea how to get a HttpServletResponse object that isn't 
connected to the clients browser but just can provide a rendered code as 
String for further serverside handling?

Or

How can i return a string after calling forward or include method for 
further processing in the server-side?


Looking forward to your suggestions!
Regards

----------------------------------------------------------------------------
The Web Security Mailing List
http://www.webappsec.org/lists/websecurity/

The Web Security Mailing List Archives
http://www.webappsec.org/lists/websecurity/archive/



More information about the websecurity mailing list