nitin yeola wrote:Thanks.
Then I have to change path every time wherever I have to installed my application..
Because I have testsite, localsite, production so need to careful everytime while deploying application.
A WAR that has to be custom-built depending on where it's being deployed isn't "complete". If you do it right (admittedly, it's extra work), the same WAR can be used everywhere. That's my preferred approach, since it saves me from accidentally dropping the wrong WAR on the wrong server AND it ensures that when I
test, the WAR is the same WAR that's running in production.
One of the best ways to ensure this portability is to use the Tomcat Context resource definition elements. You set them in each Tomcat server as part of the initial deployment, and in most cases, you leave them there unchanged thereafter. They contain the host-dependent settings such as what security Realm you're using, locations of external workfile directories, locations of log directories, and whatever else may vary from server to server. The values can be retrieved in the webapp using JNDI.