Setting Tomcat3.1 with Apache > web.xml
Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me

web.xml

Any questions and comments are welcome to me.

1: What we specify in this file

'web.xml' file must reside in 'WEB-INF' directory under each document base directory, which is specified in 'server.xml' corresponds to each context. In our exmaple,

is responsible for configuration of '/jun-app' context. In this XML file, we can specify what servlets are available in the corresponding context, what parameters and values are passed to these servlets at thier initialization time, the paths to them and so on. It looks like this:

    <servlet>
        <servlet-name>
            jun_test
        </servlet-name>
        <servlet-class>
            TestServlet
        </servlet-class>
        <init-param>
            <param-name>
	        jun_para
            </param-name>
            <param-value>
		hello
            </param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>
	  jun_test
        </servlet-name>
        <url-pattern>
          /myservlet
        </url-pattern>
    </servlet-mapping>

The request of "http://www.foo.com/jun_app/myservlet" is redirected to Tomcat by JServ, and Tomcat invokes providing "jun_para=hello" with it as initial parameter.

2: Configuration for StatusServlet

In case that you applied my patch and you'd like enable com.oopreserch.tomcat.servlets.StatusServlet, you need to regiter it in this file with the appropriate 'url-pattern'.
To handle the request from the 'jserv-status' function of the JServ module, the servlet server must hold the servlet which can be invoked by the 'url-pattern' of '/org.apache.jserv.JServ'. As I described above, the mapping of the 'url-pattern' and the servlet can be defined in 'WEB-INF/web.xml' which resides in the document base corresponding to the requested context. In case of this request, such a servlet must be stored in the context of "", which can be configured by

This file must contains the following elements:

You may wonder where 'org.apache.tomcat.servlets.StatusServlet' class file is stored. It is already stored $TOMCAT_HOME/lib/webserver.jar by running 'build_oop.sh' as decribed in my document about my patch. With this example configuration, we can see the configuration both of JServ and Tomcat by the request of

Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.


Previous Page Contents Next Page
OOP-Reserch home page

Mail to Me


ALL CONTENTS COPYRIGHT 2000 , Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori .