Reputation: 6969
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.
There are several ways that I am aware of:
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?
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.
Upvotes: 2
Views: 1071
Reputation: 26713
I think JNDI was invented for exactly the purpose you are asking for:
Upvotes: 1