Search code examples
javaservletsjbossweb.xml

Is there a way to resolve system properties in a web.xml file?


I added a system property in my run.conf of my JBOSS like this:

JAVA_OPTS="$JAVA_OPTS -Dfoo=bar"

Now my question is, if there is a way to resolve this property in a web.xml file in a way something like this:

...
<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
    classpath:applicationContext-common.xml
    classpath:conf/${foo}/applicationContext-local.xml
  </param-value>
</context-param>
...

Solution

  • I don't know any possibility. But in my opinion this should be implemented in the application. Why you wanna increase the indirection? Normaly you access the contents of the web.xml from within you application ( app > web.xml). Why do this: app > web.xml > environment variable?