tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Richard Sand)
Subject Re: Bug: Tomcat setting wrong host on redirect
Date Sun, 30 Jul 2000 04:10:57 GMT
Exactly!  The FQDN should be pulled from the client's request, because the
webserver is unaware of what translation (name, port, etc) is going on
between the web server and the client.  I'll try Tomcat 3.2, hopefully it
will be a full release soon!


-----Original Message-----
From: Craig R. McClanahan <>
To: <>
Date: Saturday, July 29, 2000 8:33 PM
Subject: Re: Bug: Tomcat setting wrong host on redirect

>Richard Sand wrote:
>> Hi- I've switched to another servlet engine to test and confirmed that
>> is a bug in Tomcat.  It should not insert the hostname into the redirect.
>Um, have you checked the 2.2 spec?  In Section 6.3, it says:
>    "It is legal to call this method with a relative URL path,
>    however the underlying container must translate the
>    relative path to a fully qualified URL for transmission back
>    to the client."
>> If I browse to and the servlet does a
>> response.sendRedirect("/nextpage.html"), the browser should go to
>>, not the internal hostname of the web
>> Any suggestions?  Tomcat is 3.1, web server is Apache on Solaris (sparc).
>Upgrade to Tomcat 3.2, which grabs the hostname (and port) from the
>request when it creates the absolute URL of the response.
>> -Richard
>Craig McClanahan
>> -----Original Message-----
>> From: Richard Sand <>
>> To: <>
>> Date: Saturday, July 29, 2000 1:40 AM
>> Subject: Tomcat setting wrong host on redirect
>> >Hi all- whenever I do a respond.sendredirect, Tomcat inserts the actual
>> >hostname of the web server into the redirect, instead of the hostname
>> >the request or the hostname as specified in my Apache httpd.conf.  For
>> >example, externally, my server is known as, whereas on
>> >inside it is simply known as "abc".  So on every redirect, the browser
>> >told to go to http://abc/mytarget which it then expands to
>> > which is, of course, totally wrong!
>> >
>> >Is there some way to force Tomcat to put the proper host into the
>> >Perhaps some tag in the server.xml that isn't there at the moment?
>> Thanks!!
>> >
>> >-Richard
>> >
>> >

View raw message