GeeCON Prague 2014*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
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: 12792
    
    5
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
 
GeeCON Prague 2014
 
subject: Are URL parameters (GET) not resent when you do a response.sendRedirect()?