Re: sending redirects to relative/absolute URLs
Hi Angelov, Am Freitag, 20. Mai 2005 15:53 schrieb Angelov, Rossen: > Hi, > Does anybody know why Tomcat always redirects to absolute links? > > I looked at the implementation and the sendRedirect calls the > toAbsolute method which always constructs an absolute URL. > Is there any way to make Tomcat return relative URLs the way they > were requested for redirecting? I would say that sendRedirect will set the HTTP header field "Location". According to the specification of the "Hypertext Transfer Protocol -- HTTP/1.1" / RFC 2616, this field requires an absolute URL: "The field value consists of a single absolute URI." -> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 Best wishes Lutz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sending redirects to relative/absolute URLs
Section 14.30 of the http spec. rfc2616 http://www.faqs.org/rfcs/rfc2616.html Jon Angelov, Rossen wrote: Len, Can you point me a place where I can read about these HTTP requirements? I thought this might be the case but I couldn't find anything helpful online. Probably didn't search enough. -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Friday, May 20, 2005 9:28 AM To: Tomcat Users List Subject: Re: sending redirects to relative/absolute URLs No, because the HTTP protocol requires an absolute URL in redirect responses. On 5/20/05, Angelov, Rossen <[EMAIL PROTECTED]> wrote: Hi, Does anybody know why Tomcat always redirects to absolute links? I looked at the implementation and the sendRedirect calls the toAbsolute method which always constructs an absolute URL. Is there any way to make Tomcat return relative URLs the way they were requested for redirecting? Ross "This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] "This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: sending redirects to relative/absolute URLs
Len, Can you point me a place where I can read about these HTTP requirements? I thought this might be the case but I couldn't find anything helpful online. Probably didn't search enough. -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Friday, May 20, 2005 9:28 AM To: Tomcat Users List Subject: Re: sending redirects to relative/absolute URLs No, because the HTTP protocol requires an absolute URL in redirect responses. On 5/20/05, Angelov, Rossen <[EMAIL PROTECTED]> wrote: > Hi, > Does anybody know why Tomcat always redirects to absolute links? > > I looked at the implementation and the sendRedirect calls the toAbsolute > method which always constructs an absolute URL. > Is there any way to make Tomcat return relative URLs the way they were > requested for redirecting? > > Ross > > > "This communication is intended solely for the addressee and is > confidential and not for third party unauthorized distribution." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] "This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution."
Re: sending redirects to relative/absolute URLs
No, because the HTTP protocol requires an absolute URL in redirect responses. On 5/20/05, Angelov, Rossen <[EMAIL PROTECTED]> wrote: > Hi, > Does anybody know why Tomcat always redirects to absolute links? > > I looked at the implementation and the sendRedirect calls the toAbsolute > method which always constructs an absolute URL. > Is there any way to make Tomcat return relative URLs the way they were > requested for redirecting? > > Ross > > > "This communication is intended solely for the addressee and is > confidential and not for third party unauthorized distribution." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sending redirects to relative/absolute URLs
Hi, Does anybody know why Tomcat always redirects to absolute links? I looked at the implementation and the sendRedirect calls the toAbsolute method which always constructs an absolute URL. Is there any way to make Tomcat return relative URLs the way they were requested for redirecting? Ross "This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution."