Document Information


Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Pages Technology

What Is a JSP Page?

A Simple JSP Page Example

The Example JSP Pages

The Life Cycle of a JSP Page

Translation and Compilation



Handling JSP Page Errors

Creating Static Content

Response and Page Encoding

Creating Dynamic Content

Using Objects within JSP Pages

Using Implicit Objects

Using Application-Specific Objects

Using Shared Objects

Unified Expression Language

Immediate and Deferred Evaluation Syntax

Immediate Evaluation

Deferred Evaluation

Value and Method Expressions

Value Expressions

Method Expressions

Defining a Tag Attribute Type

Deactivating Expression Evaluation

Literal Expressions

Resolving Expressions

Process of Expression Evaluation

EL Resolvers

Implicit Objects


Reserved Words

Examples of EL Expressions


Using Functions

Defining Functions

JavaBeans Components

JavaBeans Component Design Conventions

Creating and Using a JavaBeans Component

Setting JavaBeans Component Properties

Retrieving JavaBeans Component Properties

Using Custom Tags

Declaring Tag Libraries

Including the Tag Library Implementation

Reusing Content in JSP Pages

Including an Applet

Setting Properties for Groups of JSP Pages

Deactivating EL Expression Evaluation

Declaring Page Encodings

Defining Implicit Includes

Eliminating Extra White Space

Further Information about JavaServer Pages Technology

6.  JavaServer Pages Documents

7.  JavaServer Pages Standard Tag Library

8.  Custom Tags in JSP Pages

9.  Scripting in JSP Pages

10.  JavaServer Faces Technology

11.  Using JavaServer Faces Technology in JSP Pages

12.  Developing with JavaServer Faces Technology

13.  Creating Custom UI Components

14.  Configuring JavaServer Faces Applications

15.  Internationalizing and Localizing Web Applications

Part III Web Services

16.  Building Web Services with JAX-WS

17.  Binding between XML Schema and Java Classes

18.  Streaming API for XML

19.  SOAP with Attachments API for Java

Part IV Enterprise Beans

20.  Enterprise Beans

21.  Getting Started with Enterprise Beans

22.  Session Bean Examples

23.  A Message-Driven Bean Example

Part V Persistence

24.  Introduction to the Java Persistence API

25.  Persistence in the Web Tier

26.  Persistence in the EJB Tier

27.  The Java Persistence Query Language

Part VI Services

28.  Introduction to Security in the Java EE Platform

29.  Securing Java EE Applications

30.  Securing Web Applications

31.  The Java Message Service API

32.  Java EE Examples Using the JMS API

33.  Transactions

34.  Resource Connections

35.  Connector Architecture

Part VII Case Studies

36.  The Coffee Break Application

37.  The Duke's Bank Application

Part VIII Appendixes

A.  Java Encoding Schemes

B.  About the Authors



Transferring Control to Another Web Component

The mechanism for transferring control to another web component from a JSP page uses the functionality provided by the Java Servlet API as described in Accessing a Session. You access this functionality from a JSP page by using the jsp:forward element:

<jsp:forward page="/main.jsp" />

Note that if any data has already been returned to a client, the jsp:forward element will fail with an IllegalStateException.

jsp:param Element

When an include or forward element is invoked, the original request object is provided to the target page. If you wish to provide additional data to that page, you can append parameters to the request object by using the jsp:param element:

<jsp:include page="..." >
    <jsp:param name="param1" value="value1"/>

When jsp:include or jsp:forward is executed, the included page or forwarded page will see the original request object, with the original parameters augmented with the new parameters and new values taking precedence over existing values when applicable. For example, if the request has a parameter A=foo and a parameter A=bar is specified for forward, the forwarded request will have A=bar,foo. Note that the new parameter has precedence.

The scope of the new parameters is the jsp:include or jsp:forward call; that is, in the case of an jsp:include the new parameters (and values) will not apply after the include.