tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fillon, Jérôme" <J.Fil...@saq.qc.ca>
Subject Servlet Chaining a solution ?
Date Fri, 07 Apr 2000 12:28:02 GMT
Hi all,

I had some troubles with servlet chaining these days with Tomcat. My code
worked perfectly well with the web browser included in VAJ (Apache modified
by IBM i think).

I used the *classic* code :

	RequestDispatcher otherServlet =
getServletContext().getRequestDispatcher(MyURL);
	otherServlet.forward(req, resp);

The main problem was what to write in the MyURL string...

I have created another application in Tomcat, i modified the server.xml for
Tomcat and added a sub directory called myproject.

        <Context path="/myproject" docBase="webapps/myproject" debug="0"
reloadable="true" > 
        </Context>

I added that line in the file server.xml in the conf directory.

Then i can called my servlets which are in the directory Web-Inf/classes
under webapps/myproject. You will need to create a web.xml file. Mine is
minimal :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
</web-app>


In my browser i load my servlet with
http://127.0.0.1:8080/myproject/servlet/package.MyServlet to redirect to
MyOtherServlet i need to use
MyURL="/servlet/package.MyOtherServlet" and not
"/myproject/servlet/package.MyOtherServlet"

Simple ?! :) (btw Absolute URL don`t seem to work...)


Hope it helps someone.

Jerome.

I`m using Tomcat for 2 days and i have ported my EJBs from
WebSphere/IBMApache to Jonas/Tomcat easily. The configuration of Tomcat and
Jonas was so easy... i`m really impressed.
Why companies always want to buy a brand name with bad support... they
should definetly fund those projects.







Mime
View raw message