The JavaTM Web Services Tutorial
Home
TOC
Index
PREV TOP NEXT
Divider

Web Application Life Cycle

A Web application consists of Web components, static resource files such as images, and helper classes and libraries. The Java WSDP provides many supporting services that enhance the capabilities of Web components and make them easier to develop. However, because it must take these services into account, the process for creating and running a Web application is different from that of traditional stand-alone Java classes.

Certain aspects of Web application behavior can be configured when the application is deployed. The configuration information is maintained in a text file in XML format called a Web application deployment descriptor. A deployment descriptor must conform to the schema described in the Java Servlet specification.

The process for creating, deploying, and executing a Web application can be summarized as follows:

  1. Develop the Web component code (including possibly a deployment descriptor).
  2. Build the Web application components along with any static resources (for example, images) and helper classes referenced by the component.
  3. Install or deploy the application into a Web container.
  4. Access a URL that references the Web application.

Developing Web component code is covered in the later chapters. Steps 2 through 4 are expanded on in the following sections and illustrated with a Hello, World style presentation-oriented application. This application allows a user to enter a name into an HTML form (Figure 4-1) and then displays a greeting after the name is submitted (Figure 4-2):

Figure 4-1 Greeting Form

Figure 4-2 Response

The Hello application contains two Web components that generate the greeting and the response. This tutorial has two versions of the application: a servlet version called Hello1, in which the components are implemented by two servlet classes, GreetingServlet.java and ResponseServlet.java, and a JSP version called Hello2, in which the components are implemented by two JSP pages, greeting.jsp and response.jsp. The two versions are used to illustrate the tasks involved in packaging, deploying, and running an application that contains Web components. If you are viewing this tutorial online, you must download the tutorial bundle to get the source code for this example. See Running the Examples.

Divider
Home
TOC
Index
PREV TOP NEXT
Divider

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.