[jetty-user] Possible to perform substitution on context-params?
Michael Spoonauer <[email protected]>
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <[email protected]> |
Let me give an example. We want the location for our log4j configuration
file to vary based on the environment we are in, so that its log levels can
be tweaked and those levels won't be lost if the application is redeployed
from the WAR. Thus, we would like to define a context-param with a value of
${configBase}/log4j_${env}.xml, where both "configBase" and "env" are
replaced with System properties at runtime.
Now Tomcat is nice enough to automatically convert the above to, in our
case, file:///etc/company/conf/log4j_PROD.xml, because it automatically
performs System property substitution on all context-params, perhaps at the
time that they are requested using ServletContext.getInitParam().
Is there any way to achieve something similar in Jetty? Or can someone
think of a way to achieve the same result that is not necessarily dependent
on the specific J2EE container. There doesn't seem to be an easy way to
wrap a ServletContext object.
Thanks,
Mike