3

I'd like to know how to configure tomcat 6 in order to be able to replace a file from a war - for instance an image or a jsp - so I don't need to restart the server to keep it updated. I assume I'll have to deploy it as a directory - not just copying the war file to webapp ?

Thanks.

3 Answers 3

1

If you have access to the server you can explode the WAR to a separate directory (using jar -xf application.war) and then add the web-app to the Tomcat instance TOMCAT_ROOT/conf/Catalina/localhost directory.

For example - if your application were called "my-app" you would create a file within TOMCAT_ROOT/conf/Catalina/localhost/my-app.xml which contained details of the application. For a very simple application this might just be something like:

<Context docBase="/path/to/exploded/application/directory"/>

You might also have more complicated configuration (such as database connection parameters, etc.) within here.

If you then want to redeploy the application after you've changed an individual object (JSP, image, etc.) you can use the manager app to redeploy without having to restart the whole Tomcat environment.

0
0

You can deploy application by removing the *.war from the webpps directory.


$ rm -fr /var/lib/tomcat5/webapps/myapp.war

Also you can do that, if you connect to tomcat jmx manager http://server/manager/html, so select the application that you need to remove and click on deploy.

1
  • 1
    Thanks for your answer, but that's exactly what I don't want to do. I want to even edit a jsp file, change let's say an image reference, and I want tomcat to acknowledge the modification accordingly.
    – xain
    Mar 9, 2010 at 13:28
0

Yes, deploy a directory. You can also push a new .war file and Tomcat will do the right thing without the need for restarting Tomcat.

IIRC, you can modify files of an exploded war file, and it will work. But it will cause problems (the war will be reexploded on restart, for instance, and overwrite).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .