Tomcat Question

Discussions

Web tier: servlets, JSP, Web frameworks: Tomcat Question

  1. Tomcat Question (6 messages)

    Hi,

    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?
    thank you
    A

    Threaded Messages (6)

  2. Tomcat Question[ Go to top ]

    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.
  3. Tomcat[ Go to top ]

    Try reloading it
  4. Tomcat Question[ Go to top ]

    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.
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html

    If you add any new actions or change anything else in struts-config.xml you will still have to restart the server.
  5. Tomcat Question[ Go to top ]

    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.
  6. Tomcat Question[ Go to top ]

    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">

    /Klas
  7. Tomcat Question[ Go to top ]

    I agree with Paul Gear. That is the solution. In case of JBoss, it redeploys it automatically.