Sun Logo


Building Web Components

Fortetrademark for Javatrademark Programming Series

816-4337



Contents

Before You Begin

1. Addressing the Challenges of Web Application Development

What Is a Web Application?

Challenges in Developing Web Applications

How Web Application Development Is Different

Implications of Server-Centered Execution

How the IDE Helps

Full Web Component Support

Execution Support

Debugging and Monitoring Tools

Deployment Support

Open Runtime Environment Integration

Common Errors in Web Applications

Facing the Challenges of Web Application Debugging

Tracking Requests With the HTTP Monitor

Summary of IDE Features

2. The Structure of Web Applications

Web Servers

Servlet Containers and Web Components

Servlet Context

Web Modules

JSP Pages

JSP Page Life Cycle

Code Constructs in JSP Pages

HTTP Sessions

Scopes and Implicit Objects

Servlets

Servlet Life Cycle

Tag Libraries

JSP Standard Tag Library

Servlet Filters

Filter Life Cycle

Listeners

3. Design Patterns and Frameworks

Design Patterns

Front Controllers

Composite Views

View Creation Helpers

Model Objects

Frameworks

Struts

JATO

JavaServer Faces

4. Developing Your Own Web Application

Development Work Flow

Web Modules in the IDE

Creating a Web Module

Importing an Existing Web Module

Creating JSP Pages

Using page Directives

Creating and Invalidating Sessions

Modifying the JSP File

Working With JSP Includes

Creating a Composite View Template

Using Additional Classes or Beans

Creating Servlets

Declaring the Servlet in the Deployment Descriptor

Modifying the Servlet

Servlet-Generated HTTP Responses

Using the Servlet as a Front Controller

Using Additional Classes or Beans

Creating Filters

Declaring the Filter in the Deployment Descriptor

Processing HTTP Requests and Responses

Using Tag Libraries

Using Existing Tag Libraries

Tag Library Descriptors

Inserting Custom Actions From a Tag Library Into a JSP Page

Developing Your Own Tag Libraries

Testing Tag Libraries

Working With Databases

5. Running, Debugging, and Deploying Your Web Application

Running and Debugging Tasks

Configuring the Web Module Deployment Descriptor

Using Property Sheets to Edit the web.xml File

Registering Servlets and Filters

Registering Tag Libraries

Specifying the Default URI Within the Taglib Element

Using the IDE to Edit the web.xml File in the Source Editor

Using Tomcat 4.0

Test Running Web Modules on the Internal Tomcat 4.0.1 Server

The Tomcat 4.0 Server Configuration File

Setting Up the Web Server Environment for Database Access

Executing a Single Web Module

Creating and Executing a Web Module Group

Executing on Tomcat Servers

Debugging Web Applications

Using the HTTP Monitor to Debug a Web Application

Source-Level Debugging

Packaging Your Web Applications

Building a WAR File From a Web Module

Specifying Options

Viewing Contents

Packaging and Deploying a Custom Tag Library

Packaging a Tag Library as a JAR File

Deploying a Tag Library Using the Tag Library Repository

Deploying a Tag Library by Adding a JAR File From the Filesystem

Deploying a Tag Library by Copying and Pasting a JAR File From Another Module or Filesystem

Including a Web Module Within a J2EE Web Application

Glossary

Index