John Ellis wrote:

> According to the dtd:
> http://java.sun.com/j2ee/dtds/web-app_2.2.dtd
> There is an "env-entry" tag that has name-value pairs like you mentioned.  The
> version of tomcat that I am using (3.1) did not seem to being doing anything
> with this entry.  It does seem like it would be the perfect place for exactly
> what you are talking about.
>

The <env-entry>, <resource-ref>, and <ejb-ref> values in the deployment descriptor
are for use when you are running a servlet container inside a J2EE server.  Tomcat
doesn't support them when running standalone.

A good way to introduce application-wide initialization parameters, though, is to
use the <context-param> element.  Values you enter here can be retrieved from any
servlet or JSP page in the web app like this:

    String value = getServletContext().getInitParameter("name");


>
> Does anyone know what this entry is (the dtd description did not specifically
> say how to get these values back -- I am assuming System.getProperties())?  Does
> anyone know if more current version of tomcat support it?  Will future versions?
>

You would not really want to use system properties for this in the first place.
What would you do if you're running two different web apps in the same servlet
container, and they both needed a property named "abc"?

>
> John
>

Craig McClanahan


Reply via email to