This was news to me too. But, from the horse's mouth:
RFC 2616 HTTP/1.1 June 1999
If the 302 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.
Note: RFC 1945 and RFC 2068 specify that the client is not allowed
to change the method on the redirected request. However, most
existing user agent implementations treat 302 as if it were a 303
response, performing a GET on the Location field-value regardless
of the original request method. The status codes 303 and 307 have
been added for servers that wish to make unambiguously clear which
kind of reaction is expected of the client.
So, in theory, you should generate a 303 response if the request method was
POST, and the web page you're redirecting to should be retrieved with a GET.
But in practice, the web browser will do just what you expect it to do if a
302 response is received.
Dan.
Post by Filip Hanik-----Original Message-----
Sent: 30 January 2003 16:01
To: Tomcat Users List
Subject: Re: Redirect and Tomcat
Post by Paul YunusovRoman,
The HTTP1.1 spec says the client should follow the redirect
only if the method
Post by Paul Yunusovis GET or HEAD, so check that.
Pardon for butting in, but does this mean that my login servlet which
accepts and processes a POST request, then uses response.sendRedirect()
to send the user to a different resource (another servlet), is invalid?
Erik
---------------------------------------------------------------------