Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging property values while redeploying new version of .war in tomcat
    text
    copied!<p>In my Java web application where I am using tomcat as my app server, I am interested in a way of passing different value to a particular property to the application when it is deployed/redeployed.<br> There are several ways that I am aware of: </p> <ol> <li>One is through JVM options passed to the tomcat set in setenv.sh file. Requires server to be restarted for each redeployment as far as I know.</li> <li>To specify the property values in properties file. Requires the values set manually by hand in the file and rebuilding the application before each redeployment of the same version of the application. </li> <li>While using spring, specifying the property value in some bean defined in the applicationContext.xml file. Again requires manual approach and app rebuilding.</li> <li>Storing configuration in the database. This requires that we know the connection properties for the database storing such configurations.</li> </ol> <p>Now if I plan to change certain property variable such as an IP address, number of connections, port number or some other such variable every time deploying/redeploying the app, what strategy should I follow? Is there a popular well accepted way of passing such property values to web application deployed in tomcat? Is it necessary to restart the tomcat server if I pass the property value as JVM options?</p> <p>Or is there any other generic way for configuring the deployment parameters that I have not mentioned above? I would prefer a process which can easily be automated to be done programmatically(like passing JVM options), instead of setting properties by hand before each deployment(like setting properties file). It should also not require the rebuild of same version each time before redeployment. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload