|
Download
FAQ History |
|
API
Search Feedback |
Installing Web Applications
A context is a name that gets mapped to a Web application. For example, the context of the
hello1application is /hello1. To install an application into Tomcat, you notify Tomcat that a new context is available. Note that an installed application is not available after Tomcat is restarted. To permanently deploy an application you invoke the manager application deploy command (see Deploying Web Applications). Installing an application is the recommended operation when you are iteratively developing an application because you do not have to package the WAR and because you can quickly reload an updated application.You install an application into Tomcat with the manager application
installcommand invoked via theAntinstalltask. TheAntinstalltask tells the manager running 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.The
usernameandpasswordattributes are discussed in Appendix B.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:Note that the context entry specifies the location of the Web application through its
docBaseattribute.The tutorial example build files contain an
Antinstallandinstall-configtargets that invoke theAntinstalltask:<target name="install" description="Install web application" depends="build"> <install url="${url}" path="${mywebapp}" war="file:build" username="${username}" password="${password}"/> </target> <target name="install-config" description="Install web application" depends="build"> <install url="${url}" path="${mywebapp}" config="file:build/context.xml" username="${username}" password="${password}"/> </target>These tasks require that a Web application deployment descriptor be available. All of the tutorial examples are distributed with a deployment descriptor.
To install the
hello1application described in Web Application Life Cycle:
|
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.