JBoss Community

Change env-entry-value at runtim

created by - - in JNDI and Naming - View the full discussion

Hello

 

I would like a part of my webapp configuration to be server-dependant, meaning I want to have a different value when deploying in my jboss dev instance and in the production environment. And I would like not to repackage the development WAR before deploying in production env, nor would I like to restart the server to take some config file into account.

 

I guessed that JNDI could help (but I may be wrong, any comment will be much appreciated...)

 

But there is no way I can found to edit at runtime the env-entry that I've added to my web.xml file.

 

I was able to do this with Tomcat using the "admin tool" (I could see the set of env-entries of my web.xml in the "Resources / Environment entries" section).

 

Here is my web.xml file:

<web-app id="JndiVarUse">

    <!-- some servlet and servlet mapping definitions -->

    <env-entry>

        <env-entry-name>message</env-entry-name>

        <env-entry-value>Message from web.xml</env-entry-value>

        <env-entry-type>java.lang.String</env-entry-type>

    </env-entry>

</web-app>

 

By the way, here is another question: how come I can't see the env-entry in the JMX JNDIView with JBoss 5.1 whereas it could be seen with JBoss 4.2.3 ?

 

Thanks for the help !

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community