tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaj Kandler <>
Subject Re: Setting Java property inside a webapp
Date Wed, 14 Nov 2007 19:48:10 GMT
Hash: SHA1

Thanks Christopher,
I appreciate the quick response.

Trickily I can't change the library (forgot to mention that), so I have
to depend on the property value and can't change it to a JNDI lookup.

Well, I did the following:
As I use Spring anyway, I created a bean property, that if set will also
set the JVM property, not too great, but should work, as the value is
global for all in the tomcat.

Any objections to this?

Christopher Schultz wrote:
> Kaj,
> Kaj Kandler wrote:
>> Hi there,
>> I do have a library, that uses a property to determine some
>> configuration. As a straight Java program I would call
>> java ...
>> How can I set this property in the context of a tomcat webapp, like in
>> the web.xml or context.xml?
> Neither web.xml now context.xml will set system properties. You /can/
> have either of these files stick things into the JNDI context, though.
> See
> Entries
> for more information.
> If you /need/ to use system properties, you could write a
> ServletContextListener to peek into JNDI and copy those values into he
> system properties of the JVM. Just remember that system properties are
> JVM-global, whereas JNDI resources are private to the application. If
> you deploy two applications with different settings within the same JVM,
> they will interfere with each other.
> -chris

- ---------------------------------------------------------------------
To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

- --

*** Technical support for non technical users of ***
***                           ***
Version: GnuPG v1.4.6 (MingW32)


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message