tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: RequestDispatcher.forward between 2 virtual hosts defined in the same Tomcat container
Date Tue, 11 Aug 2015 19:35:29 GMT
On 06/08/2015 13:40, Neha Munjal wrote:
> Hi,
> 
> I would like to know if we can do servlet forwarding between 2 different
> webapps deployed on 2 different virtual hosts configured in the same Tomcat
> container.

No.

Mark


> 
> So, I have configured 2 different virtual hosts in my Tomcat server.xml as
> follows:
> <Host name="firstservlet" appBase="firstservletapps"/>
>  <Host name="secondservlet" appBase="secondservletapps"/>
> 
> and put the root.xml file for default webapps to:
> 
> $CATALINA_HOME/conf/Catalina/<virtualhost> directory.
> 
> servlet2 is deployed as a different war in the 2nd virtual host.
> 
> I notice that when I try to fetch the context of servlet2 from
> Servlet1 to do a forward from Servlet1 to Servlet2, the loaded context
> is null and so there is forwars. Please note that crossContext
> attribute is set to true in the context.xml for the 1st war.
> 
> Also, noticed that in case I do not define any explicit virtual hosts
> and deploy both the wars in the default host i.e localhost, the
> forwarding works fine.
> 
> Can somebody please let me know if servlet.forward works with virtual hosts.
> 
> Any suggestions would be highly appreciated.
> 
> 
> Thanks
> 
> Neha
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message