tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Xia <>
Subject RE: Reading initialization parameters from web.xml
Date Tue, 20 Jun 2000 14:15:14 GMT
Try this:

-----Original Message-----
From: Bedell, Kevin []
Sent: Tuesday, June 20, 2000 8:50 AM
To: ''
Subject: Reading initialization parameters from web.xml

I'm having trouble getting parameters read in from my web.xml file. 

I've attached a sample code snippet that tries to read all parameters in and
simply print them out for debugging. The results of the code are that no
paramters are read in or printed.

Also I've attached my web.xml file -

Anyone have any ideas?



Code snippet trying to read init parameters:

    Enumeration enum = getInitParameterNames();
    while (enum.hasMoreElements()) {
      String name = (String) enum.nextElement();
      out.println(name + " : " + getInitParameter(name));

Contents of web.xml file:

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

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

  <display-name>A Test app for parameter passing</display-name>
      <param-value>This is only a test - parameter!</param-value>
         This parameter is here to test the web.xml functionality

To unsubscribe, email:
For additional commmands, email:

View raw message