tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Pringle <>
Subject Getting an absolute path into a servlet's context-param value w/o hardcoding in web.xml
Date Fri, 29 Jul 2011 23:04:41 GMT
Hi all,

We have a 3rd party application that is deployed into our environment.  As it is 3rd party
we have no control over changing the servlet code itself.

As part of the "configuration" of the servlet to be deployed into an environment, it wants
a directory path passed as a servlet context parameter:


In our environments, "/path/to/directory" will be different for different deployments, and
so we don't want to hardcode this into the web.xml else the WAR is non-portable.

A very annoying work around we came up with is to specify a relative path, but this has the
nasty effect of forcing the container to be started from a specific directory (ops guys don't
like that!):


I'm sure there's a better way to do this, but am still scratching my head.

Does tomcat still dereference the system properties when parsing a WAR's web.xml?  Would something
like this work?



I've also thought about a custom listener or similar that would load before the context-params
are read and set the context-param value by reading a system property set via


--Jason Pringle

This message and the information contained herein is proprietary and confidential and subject
to the Amdocs policy statement,
you may review at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message