I have written a web application based on struts framework.
when I make changes to any of the classes I have to shutdown the tomcat server, move the new classes to the appropriate directory and restart. this can get very tedious, So does any one know of how to tackle this problem?
Tomcat does not support hot deployment with anything other than JSPs. Hey, it's a free reference implementation, what do you expect ;-) The good news is that the startup/shutdown process is much faster than most other containers.
Try reloading it
Check the Tomcat documentation for the server.xml configuration file. You can set reloadable="true" in the context and your class files will be reloaded when they change.
If you add any new actions or change anything else in struts-config.xml you will still have to restart the server.
When developing with Tomcat I set my dev directory inside of webapps. This way when I rebuild the classes I can simply restart the instance instead of the container. I set of my browser tabs (insert Mozilla/Opera/Safari/etc. plug here :)) to tomcat manager so after making changes I can restart whatever instance I'm working on in one tab and view the changes in another.
Hope you find this useful.
I use Ant to build an war-file and config my apps Conetxt in server.xml to point out the war-file, no need to have dev projects in tomcats directory structure.
Compile and restart!
sample for server.xml:
<Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="0" docBase="D:/JAVA/AWEB/dist/aweb.war" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/lfweb" privileged="false" reloadable="false" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
I agree with Paul Gear. That is the solution. In case of JBoss, it redeploys it automatically.