aspose file tools*
The moose likes Servlets and the fly likes sendRedirect method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "sendRedirect method" Watch "sendRedirect method" New topic
Author

sendRedirect method

Derek Nahabedian
Greenhorn

Joined: Jun 21, 2011
Posts: 3

I understand when a sendRedirect is executed, a 301 or 302 response is sent to the client, along with the desired URL. The browser then issues a new request for the desired URL.

My question is what HTTP method is generated under the hood? Get or Post?
Can a Get / Post be specified?

Thank you
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

The browser will generate a new Get request in response to your 300-sequence response. You don't have any choice about that.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

And thank goodness. It's what enables the P-R-G pattern!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Derek Nahabedian
Greenhorn

Joined: Jun 21, 2011
Posts: 3

Thank you both - I am reading up on the PRG pattern.
 
 
subject: sendRedirect method