This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes Are URL parameters (GET) not resent when you do a response.sendRedirect()? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Are URL parameters (GET) not resent when you do a response.sendRedirect()?" Watch "Are URL parameters (GET) not resent when you do a response.sendRedirect()?" New topic
Author

Are URL parameters (GET) not resent when you do a response.sendRedirect()?

Steffen Hauser
Greenhorn

Joined: Dec 04, 2007
Posts: 6
Is this right? The URL parameters (GET) are not resent to the new resource?

Example:

http://localhost:80/myapp/myservlet01?param01=helloworld calls my servlet's doGet()-method. There I do a The second call from my browser is then http://localhost:80/myapp/myservlet02, without the ?param01=helloworld parameter.

Is this right? And why is this?



William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12327
    
    1
Of course they are not. You are redirecting to a new URL - if you want it to have parameters you have to compose the URL that way.

Redirect causes a whole new request, old request is done.

Bill

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are URL parameters (GET) not resent when you do a response.sendRedirect()?
 
Similar Threads
Passing header parameters with the request
Tomcat 404 Error - Still not working
How to view image from server ???
Trying to set http://localhost to load one tomcat project?
passing value by hyperlink