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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org