tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Response.SendRedirect problems
Date Fri, 25 Feb 2011 19:18:50 GMT
Hash: SHA1


On 2/25/2011 4:11 AM, Konstantin Kolinko wrote:
>>> It concerns the servlet response.sendRedirect(...) method.
>>> When using the response.sendRedirect("/myexample") in my java class, i do
>>> n=
>>> ot want the servlet engine to reconstruct
>>> an absolute URL, before sending the response to the browser.
> That is not possible, because of how HTTP spec is written.

It's probably not possible using response.sendRedirect, but it should be
possible using response.setStatus(302) (or whatever response code you
want) and response.setHeader("Location", "/myexample").

Note that this violates the HTTP spec
( which
says that the Location response header is fully-qualified.

>> On redirection the port number is getting omitted
> You should describe your configuration in detail first.  Though I
> think you miss "proxyPort" attribute on a connector.  (IIRC, it should
> not be necessary for AJP though).

Faheem, you can't have a relative "Location" that includes a port
number: that will require an absolute (fully-qualified) URI. If Tomcat
is incorrectly (or not at all) inserting the port number into the
Location field, please let me know.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message