Sandeep Malhotra wrote:
>
> sendRedirect(string URL) method can only be used to redirect to an
> absolute URL. Therefore, you cann't just say
> sendRedirect("filename.html").  It has to be something like,
> sendRedirect("http://somehostname/path/filename.html)
> Hope this helps!

Not so. From the documentation for the HttpServletResponse.sendRedirect
method:

"This method can accept relative URLs; the servlet container will
convert the relative URL to an absolute URL before sending the response
to the client."

It's not just a question of it says so in the docs either. It works.
(Personally speaking, I know it works with JRun and Tomcat.) There's a
possibility that this was not always the case, as there's a similar
comment about absolute URLs is in the Hunter book.

Don Ryan
Dublin Institute of Technology

___________________________________________________________________________
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

Reply via email to