The JavaTM Web Services Tutorial
Home
TOC
PREV TOP NEXT

Deploying Web Applications

The next step after you have programmed and configured a Web application is to deploy it to Tomcat. You deploy an application to Tomcat by notifying it of a new application context. The first time you deploy a new application you must restart Tomcat. Thereafter you can reload the application as described in Reloading the Examples.

Specifying the Web Application Context

A context is a name that gets mapped to the document root of a Web application. The context of the Hello1 application is /hello1. The request URL http://localhost:8080/hello1/index.html retrieves the file index.html from the document root.

Tomcat can be notified of a new context in two ways:


Note: Manual specification of the Context entry is a limitation of the current release of the Web Services Pack. Later releases will include an administration tool that will simplify this task.

Example

To deploy the Hello1 application:

  1. Go to docs/tutorial/examples/hello1 and build and deploy the example by running ant. This runs the default ant target deploy which depends on the build target. The build target will spawn any necessary compilations and copy files to the docs/tutorial/examples/web/date/build directory. The deploy target copies the build directory to <JWSDP_HOME>/webapps.
  2. Start or restart Tomcat.
Home
TOC
PREV TOP NEXT