tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bartsch Axel <Axel.Bart...@srit.siemens.fr>
Subject forward a request from servlet1 in TOMCAT1 to a servlet2 in TOMCA T2
Date Fri, 18 May 2001 12:41:03 GMT
Hi,

I am using TOMCAT 3.3 and the following code within servlet1 to forward a request

String url;
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher(url);
rd.forward(request,response);

servlet1 is called as follows:
http://<IP-adress>/test/servlet/servlet1

The TOMCAT directory:

c:\TOMCAT\webapps\test

from here subdirectorys 'common' and 'Web-inf' exist

servlet1 is known in web.xml

String url is defined as follows:
from servlet1 to servlet2
/servlet2

servlet2 is kown  in web.xml

from servlet1 to jsp2

/common/index.jsp


This works fine as long as servlet1 and servlet2, servlet1 and jsp2 are located and known
in the same TOMCAT servlet engine.

My problem is:
If servlet1 and servlet2, servlet1 and jsp2 are located on 2 different instances of the TOMCAT
servlet engine the forward does not work.
The RequestDispatcher always expects a path String relative to the root of the ServletContext.
Does anybody know a solution?


Axel   Lannion/France


Mime
View raw message