Thanks Mike.

I am currently using Struts and creating an ActionForward when firing off
the new URL.  I did not realize a redirect would create a new request (which
I what I assume happens given your explanation).  I can just set the forward
flag on the ActionForward to have the Struts framework call
HttpServletResponse.sendRedirect.

Still... I wonder why a servlet cannot modify the request parameters on the
fly.  Whereas the Servlet designers may not have found this useful, I cannot
see why they explicitly disallow it.

-----Original Message-----
From: Mike Jackson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 4:50 PM
To: Tomcat Users List
Subject: RE: Removing Request Parameters

I'm assuming that you're using a RequestDispatcher to forward the
request off.  My question is why don't you use a forward response
to the web client?  Do something like this:

        String targetUri = genUri( request );
        response.sendRedirect( targetUri );

Where the "genUri" would create the uri for the redirect.  You
could put whatever you want in the uri and do whatever filtering
you want to do.  Since with a redirect you're not passing the
same request object around (unlike the RequestDispater.forward)
it seems like it'd solve your problem.

--mikej
-=-----
mike jackson
[EMAIL PROTECTED]



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

Reply via email to