Wrap an HttpServletRequest

2001-11-14 Thread Diego del Río

Is there any way to wrap an HttpServletRequest in Tomcat 3.2.x and then
forward the wrapped request to anoher servlet?
We need a 'decorated request' with added functionality, more precisely, we
need to add 'extra-parameters' to that request and then forward it to
another servlet that process both the original and the added parameters.
Thanks,
diego

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Wrap an HttpServletRequest

2001-11-14 Thread Diego del Río

Thank you Thomas and Martin,
our problem is that the target servlet, i.e. the servlet that would receive
the 'wrapped request' forwarded by the first servlet (in this case, the
target
servlet is a jsp page), shouldn't know that the request is wrapped.
We have already implemented a lot of jsp pages (servlets at last) that
aren't
aware about attributes in the request they process.
I know that this functionality is provided by 'filters' in the servlet 2.3
spec.; unfortunately we are using Tomcat 3.2.3, a servlet 2.2 engine.

 Hi Diego,

 do it like Martin described. Or try out the RequestDispatcher:

 request.setAttribute(key1, value1);
 request.setAttribute(key2, value2);
 [...]
 RequestDispatcher rd =
 getServletContext().getRequestDispatcher(myServletUrl);
 rd.forward(request, response);

 Thomas

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]