Henric Larsson wrote:
> I hope this is an error in the spec, because the sendRedirect function is not very
>usefull if you have to calculate an absolute Url everytime you're doing a redirect.
>
> And since it works with relative Url's I see no reason why it shouldn't be allowed.
>
> .henric
>
Quick review: most servlet engines implement sendRedirect() by sending an HTTP status
code 302 (moved temporarily) and the specified URL as the value of the "Location"
header.
The reason relative URLs should not be allowed is that the HTTP spec says that the
redirected location must be an absolute URL (For HTTP/1.0, see RFC #1945, Section
10.11; For HTTP/1.1, see RFC #2068, Section 14.30).. The fact that some servlet
engines do not enforce the restriction, and that some client browsers in fact perform
the expected behavior (they tack the original protocol, host, and port back onto the
front to recreate an absolute URL) is not something you can count on in the future,
unless the HTTP spec is changed.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html