Download FAQ History |  | API Search Feedback

> ## Deploying Web Applications

> You can also notify Tomcat of a new context with the manager application `deploy` command invoked via the `Ant` `deploy` task. You can use the `Ant` `deploy` task to permanently deploy a context to Tomcat while Tomcat is running:

>       <deploy url="url" path="mywebapp"
>         war="file:/path/to/mywebapp.war"
>         username="username" password="password" />

> Unlike the `install` task, which can reference an unpacked directory, the `deploy` task requires a WAR. The task uploads the WAR to Tomcat and starts the application. You can deploy to a remote server with this task. Deploying an application is recommended operation when you have finished developing the application.

> The following other deployment methods are also available, but they require you to restart Tomcat:

> - Copy a Web application directory or WAR to `<``JWSDP_HOME``>/webapps`.
> - Copy a configuration file named `mywebapp``.xml` containing a context entry to `<``JWSDP_HOME``>/webapps`. The format of a context entry is described in the Server Configuration Reference at <`JWSDP_HOME>``/docs/tomcat/config/context.html`. Note that the context entry implicitly specifies the location of the Web application files through its `docBase` attribute. For example, here is the context entry for the application discussed in Chapter 15:

>       <Context path="/bookstore1"
>         docBase="../../jwstutorial12/examples/web/
>           bookstore1/build" debug="0">

> Some of the example build files contain an `Ant` `deploy` target that invokes the `Ant` `deploy` task.

Download FAQ History |  | API Search Feedback

All of the material in The Java(TM) Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.