tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve E. Lee" <>
Subject Tomcat 3.1: config.getInitParameter() solved
Date Thu, 27 Apr 2000 06:27:16 GMT


    Below is my configuration with Tomcat 3.1

    Thanks to Jeff Suttor<>, his configuration
    gave us a correct direction to try to solve the problem.


 1. Install Tomcat3.1. Here we use the `test' web-application that comes 
    with Tomcat 3.1, ie, the one that resides in

 2. Don't touch $TOMCAT_HOME/conf/server.xml or

 3. Add this line to $TOMCAT_HOME/conf/tomcat.conf to mount
    test web-application.

    ApJServMount /test /root

 4. Edit $TOMCAT_HOME/webapps/test/WEB-INF/web.xml:

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

<!DOCTYPE web-app
	PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"



 5. $TOMCAT_HOME/webapps/test/jsp/debug.jsp

<%@ page import="java.util.Enumeration" %>

        String arg;
        String val;
        Enumeration enum;


		out.println("Servlet name: " + config.getServletName());

        out.println("from application");
        enum = application.getInitParameterNames();
        while( enum.hasMoreElements() ) {
            arg = (String)enum.nextElement();
            val = application.getInitParameter(arg);               
            out.println(arg + " = " + val);

        out.println("from config");

        enum = config.getInitParameterNames();
        while( enum.hasMoreElements() ) {
            arg = (String)enum.nextElement();
            val = config.getInitParameter(arg);               
            out.println(arg + " = " + val);


  5. start Tomcat by $TOMCAT_HOME/bin/
     If everything is ok, you can see these: 

     5-1> $TOMCAT_HOME/logs/tomcat.log:

Context log: path="/test" Adding context path="/test" 
Context log: path="/test" Removing duplicate servlet jsp Wrapper(jsp
Context log: path="/test" Removing duplicate *.jsp -> Wrapper(jsp

     5-2> $TOMCAT_HOME/logs/servlet.log:

Context log path="/test" :tomcat.errorPage: init
Context log path="/test" :default: init
Context log path="/test" :jsp: init

  6. Now you can try http://localhost:port/test/jsp/debug.jsp


  Differences between Jeff's web.xml and ours:
  1. JSPServlet --> JspServlet
  2. Add servlet mapping.

Feel The Power, Experience The Magic.
May the Dark-Force Be With You, Good Luck.

View raw message