Can anybody tell me still how I am getting those parameters in second servlet using request.getParameter().
I am using weblogic8.1 sp5 and servlet2.3
Thanks in advance
The sendRedirect method sends a 302 header to the browser which indicates that it should make a new request with the given URL. The only way to add parameters to that request is with query string parameters.
There is, however, a way that you can ask the browser to make the original request (with the original POST method and the original form parameters) to the new URL by setting the response code to 307 and setting the location manually:
I just tried this and it worked but FireFox created a popup warning to let me, the user, know that this site is trying to redirect the entire form to a new URL.
Originally posted by Deepa More:
Hi Ben, thanks for your reply, But my question was without sending parameters thru query string or not setting response code as you said I am getting those params. Is this because of as - rathi said. Then why should one use Req. Dispatcher method.
Thanks again for reply.
Check to see what status code Weblogic sends when you call sendRedirect.
It could be that it's using 307.
You can do this with the LiveHTTPHeaders plugin for FireFox.
If you're interested in learning more about the 302 and 307 status codes, see: