Christopher Schultz wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave,

David Kerber wrote:
No, I'm using <env-entry>, with this in server.xml:

    <Environment name="fileImportInterval" type="java.lang.String"
value="60"/>

This in web.xml:
  <resource-env-ref>
      <resource-env-ref-name>fileImportInterval</resource-env-ref-name>
      <resource-env-ref-type>java.lang.string</resource-env-ref-type>
  </resource-env-ref>

Aah, okay. That's the same thing as <env-entry> in web.xml, I think.
I think I need to look at that; I'd like to eliminate the entry in server.xml if possible...

public static String getEnvironmentVariable( ... )
       InitialContext initCtx = new InitialContext();
       Context envCtx = (Context) initCtx.lookup("java:comp/env" );
       envCtx.lookup( envVarName );

That looks good.

Is that what the above method does?  Or is there another way?  Remember,
my ultimate goal here is to be able to change these settings without
bouncing my webapp.

Right. Since you are getting those values from JNDI, you can simply
replace them in JNDI. Instead of using envCtx.lookup(varName), use
envCtx.bind(varName, newValue) to change it.

Instance preference change.

A JNDI browser might simplify this for you if you can either deploy it
into your existing application, or if you can somehow connect to it from
the outside. Otherwise, you can write some quickie preference editor
yourself.
Very cool; Thanks, Chris! I didn't know I could do that. I guess that's what happens when I just copy some code from a web page, without really understanding where it's coming from.. I have already done some preference editors that use the java Preferences class, so modifying them to use this should be no trouble at all. (Or is that no 'tribble' at all <GGG>??).

Dave



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to