Deploying Web Applications to Tomcat
Subject:   Creating and Deploying a WAR File Step 4
Date:   2002-08-20 15:03:09
From:   taylormaai
In step 4 of "Creating and Deploying a WAR File" section, I think it would of been nice to mention you have to change the context entry value to docBase="onjava.war".

Did you know that if you delete context entry, and delete the real webapps/onjava directory and leave the login.war file in webapps, the default action of tomcat is to extract that war file.
But one problem, the context entry is now missing and wont serve it. However, if you put in the context entry leaving the docBase="onjava" it will not extract the onjava.war. Do you know what i'm doing wrong if i desire for it to extract rather than serve from the war?

Other than that, it was a great primer article!


Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Creating and Deploying a WAR File Step 4
    2003-10-15 12:14:27  anonymous2 [View]

    Tomcat documentation (and this article as well) are misleading by not stating that a .war file will only be expanded by Tomcat if you DON'T have a <Context ....> defined with a "docBase" attribute that matches the name of the .war file minus ".war).
  • Creating and Deploying a WAR File Step 4
    2002-08-26 10:44:05  slimd [View]

    Take a look at this page from the Tomcat documentation:

    It references your question. Here is the paragraph that I believe provides insight to your comment.

    Copy the web application archive file into directory $CATALINA_HOME/webapps/. When Tomcat is started, it will automatically expand the web application archive file into its unpacked form, and execute the application that way. This approach would typically be used to install an additional application, provided by a third party vendor or by your internal development staff, into an existing Tomcat installation. NOTE - If you use this approach, and wish to update your application later, you must both replace the web application archive file AND delete the expanded directory that Tomcat created, and then restart Tomcat, in order to reflect your changes.