You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Peer Heijnen <to...@asobrain.com> on 2001/04/24 09:40:19 UTC

Fixing error pages on virtual hosts.

Hi,

We've been using Tomcat 3.2.1 quite succesfully, but ran into trouble with
error pages on virtual domains (causing an infinite loop in 3.2.1, and a 404
in 3.2.2b3).

We fixed this problem by setting the hostname in
ord.apache.tomcat.core.ContextManager#getHandlerForPath( Context ctx, String
path ). By adding "req1.setServerName( ctx.getHost() );" after
"initRequest( req1, res1 );".

We've not studied all sources thoroughly, and I'm not sure if this is a
correct fix, but it works perfectly on versions 3.2.1 upto 3.2.2beta3 (error
pages get displayed correctly now). The servername was 'null' at the fix
point before.

Cheers,
Peter S. Heijnen



Re: Fixing error pages on virtual hosts.

Posted by cm...@yahoo.com.
Hi Peer, 

Great fix - thank's. 

I will do the fix in 3.3, and if Marc makes another beta ( for jsp fixes
) it would be great if he takes this one in. 

Marc - I know the code pretty well, and this line should have been in. I
don't think it'll affect any other piece of code, getHandlerForPath is
supposed to return a handler for the given ctx, and does so by creating a
sub-request. The subrequest must be for the ctx - and the vhost is
required.

Costin



On Tue, 24 Apr 2001, Peer Heijnen wrote:

> Hi,
> 
> We've been using Tomcat 3.2.1 quite succesfully, but ran into trouble with
> error pages on virtual domains (causing an infinite loop in 3.2.1, and a 404
> in 3.2.2b3).
> 
> We fixed this problem by setting the hostname in
> ord.apache.tomcat.core.ContextManager#getHandlerForPath( Context ctx, String
> path ). By adding "req1.setServerName( ctx.getHost() );" after
> "initRequest( req1, res1 );".
> 
> We've not studied all sources thoroughly, and I'm not sure if this is a
> correct fix, but it works perfectly on versions 3.2.1 upto 3.2.2beta3 (error
> pages get displayed correctly now). The servername was 'null' at the fix
> point before.
> 
> Cheers,
> Peter S. Heijnen
>