users@glassfish.java.net

Re: Setting a static field in different webapps

From: Sanjeeb Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 24 Jun 2010 07:37:18 +0530

On Thursday 24 June 2010 06:28 AM, glassfish_at_javadesktop.org wrote:
> Hi,
>
> I have a couple of questions about web application contexts :
>
> #1)
>
> If I have :
> - a jar mylib.jar with a class with a static field Test.myfield = "default";
> - a webapp W1 with WEB-INF/lib/mylib.jar
> - a webapp W2 also with WEB-INF/lib/mylib.jar
>
> If I trigger a
> Test.myfield = "test1" on W1
> then what will be the value if I call Test.field in W2 ?
>
>
W2 is isolated from W1 in classloading space, so it will not see changes
made by W1.
> #2)
>
> Is there a way to set system properties specifically for a webapp ?
> ex: com.sun.jndi.ldap.connect.pool.maxsize
>
I don't think this is available.

Sahoo