Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

System property use in web.xml?

Martin X Zaidel

2007-02-21

Replies:


I've inherited a webapp which includes a system property reference (ie.,
"region") in its web.xml (BTW, this context-param is used to lookup a
Spring context file---e.g. /WEB-INF/jmsContext-eur.xml)

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
       /WEB-INF/jmsContext-${region}.xml,
    </param-value>
  </context-param>

When I deploy this webapp to Tomcat 5.5.12, and define a command-line
system property with '-Dregion=eur' in catalina.sh, it works fine: the
jmsContext-eur.xml file is found.

However, when I try to deploy this webapp to Websphere 6.0.x, even after
defining a custom property for 'region' in the server profile, I get a:

java.io.FileNotFoundException: /WEB-INF/jmsContext-${region}.xml,

when the server starts.

While my immediate problem is how to deploy the webapp to Websphere, my
question to this group is this: Which component is responsible for this
behaviour (the parsing of the web deployment descriptor and the
substitution of the system property)? Is it expected J2EE 1.4
behaviour---ie., something I can complain to IBM about?

Thanks,

Martin

National Australia Bank Ltd - ABN 12 004 044 937
This email may contain confidential information. If you are not the intended recipient, please immediately notify us at postmaster@(protected).
©2008 junlu.com - Jax Systems, LLC, U.S.A.