|
Home
TOC Index |
|
Installing Web Applications
A context is a name that gets mapped to a Web application. For example, the context of the Hello1 application is /
hello1. To install an application to Tomcat, you notify Tomcat that a new context is available.You notify Tomcat of a new context with the
Antinstalltask. Note that an installed application is not available after Tomcat is restarted. To permanently deploy an application, see Deploying Web Applications.The
Antinstalltask tells themanagerrunning at the location specified by theurlattribute to install an application at the context specified by thepathattribute and the location containing the Web application files specified with thewarattribute. The value of thewarattribute can be a WAR filejar:file:/path/to/bar.war!/or an unpacked directoryfile:/path/to/foo.<install url="url" path="mywebapp" war="file:build" username="username" password="password" />The
usernameandpasswordattributes are discussed in Tomat Web Application Manager.Instead of providing a
warattribute, you can specify configuration information with theconfigattribute:<install url="url" path="mywebapp" config="file:build/context.xml" username="username" password="password"/>The
configattribute points to a configuration file that contains a context entry of the form:<Context path="/bookstore1" docBase="../docs/tutorial/examples/web/bookstore1/build" debug="0">Note that the context entry implicitly specifies the location of the Web application files through its
docBaseattribute.The tutorial example build files contain an
Antinstalltarget that invokes theAntinstalltask:<target name="install" description="Install web application" depends="build"> <install url="${url}" path="${mywebapp}" config="file:build/context.xml" username="${username}" password="${password}"/> </target>The
Antinstalltask requires that a Web application deployment descriptor (web.xml) be available. All of the tutorial example applications are distributed with a deployment descriptor.To install the Hello1 application described in Web Application Life Cycle
|
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.