|
Home
TOC Index |
|
Deploying Web Applications
There are several ways to permanently deploy a context to Tomcat while Tomcat is running:
1. Select the
- With the
Antdeploytask:<deploy url="url" path="mywebapp" war="file:/path/to/mywebapp.war" username="username" password="password" />
- Unlike the
installtask, which can reference an unpacked directory, thedeploytask requires a WAR. The task uploads the WAR to Tomcat and starts the application. You can deploy to a remote server with this task.- With
deploytool. When you choose thedeployoperation, it copies the WAR it creates to Tomcat and notifies Tomcat of the new context.
- To deploy the Hello1 application using
deploytool:hello1WAR.
2. Select ToolsDeploy.
3. Click OK to select the default context path/hello1.
4. Enter the user name and password that you supplied when you installed the Java WSDP.
5. Click Finish.
6. Dismiss the Deploy Console by clicking Close.
Two 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.xmlcontaining 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 itsdocBaseattribute. For example, here is the context entry for the application discussed in Chapter 12:<Context path="/bookstore1" docBase="../docs/tutorial/examples/web/ bookstore1/build" debug="0">Some of the example build files contain an
Antdeploytarget that invokes theAntdeploytask.
|
Home
TOC Index |
|
This tutorial contains information on the 1.0 version of the Java Web Services Developer Pack.
All of the material in The Java Web Services Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.