I have a web application that relies on some resources and parameters to be configured after it is installed, like a JDBC connection.
What I have come up with is pro
This is how we can manage to externalize webapp context from .WAR File
For e.g. I have an webapp called VirtualWebApp.
I will create file like VirtualWebApp.xml with below context definition :
To access these environment variables you have to write below code(Just lookup) :
InitialContext initialContext = new javax.naming.InitialContext();
host = (String)initialContext.lookup("java:comp/env/webservice.host");
port = (String)initialContext.lookup("java:comp/env/webservice.port");