JSTL: Practical Guide for JSP Programmers

Other | October 1, 2003

bySpielman, Sue, Sue Spielman

not yet rated|write a review
Web developers and page authors who use JavaServer Pages (JSP) know that it is much easier and efficient to implement web pages without reinventing the wheel each time. In order to shave valuable time from their development schedules, those who work with JSP have created, debugged, and used custom tags-a set of programmable actions that provide dynamic behavior to static pages-paving the way towards a more common, standard approach to using Java technology for web development. The biggest boost to this effort however has only recently arrived in the form of a standard set of tag libraries, known as the JSTL, which now provides a wide range of functionality and gives web page authors a much more simplified approach to implementing dynamic, Java-based web sites.

JSTL: Practical Guide for JSP Programmers is a timely resource for anyone interested in doing large-scale J2EE application development. It sticks to the main features of the JSTL so that developers don't have to sift through unnecessary details to begin using the tags and working with the expression language. Sue Spielman's straight-forward, practical approach is enhanced with numerous code samples and insightful descriptions to make learning the JSTL a quickly and easily accomplished task.

* Written by a best-selling author with a wealth of development experience and recognition in the Java community.
* Covers the core elements of the JSTL including the four standard tag libraries (core, internationalization/format, XML, and SQL) and expression language.
* Includes a reference section for all of the tabs and attributes contained in the JSTL.
* Via a companion web site, provides downloadable code for the code samples in the book.

Pricing and Purchase Info

$34.39 online
$44.55 list price (save 22%)
In stock online
Ships free on orders over $25

From the Publisher

Web developers and page authors who use JavaServer Pages (JSP) know that it is much easier and efficient to implement web pages without reinventing the wheel each time. In order to shave valuable time from their development schedules, those who work with JSP have created, debugged, and used custom tags-a set of programmable actions tha...

Sue Spielmanhas over 15 years hands-on experience delivering leading edge technology products. She has been working with Java ever since it was born. Sue is the President and Senior Consulting Engineer of Switchback Software LLC (www.switchbacksoftware.com) a consulting firm that specializes in business and web application development ...

other books by Spielman, Sue

The Struts Framework: Practical Guide For Java Programmers
The Struts Framework: Practical Guide For Java Programm...

Paperback|Oct 19 2002

$60.51 online$63.50list price
Jstl: Practical Guide For Jsp Programmers
Jstl: Practical Guide For Jsp Programmers

Paperback|Aug 22 2003

$47.66 online$49.95list price
Format:OtherDimensions:229 pages, 1 × 1 × 1 inPublished:October 1, 2003Publisher:Morgan KaufmannLanguage:English

The following ISBNs are associated with this title:

ISBN - 10:0080495966

ISBN - 13:9780080495965


Extra Content

Table of Contents


1 Introduction

1.1 What Exactly Is the JSTL?

1.2 Why a JSP Standard Tag Library?

1.3 Why Now?

1.4 Why You Really Want to Use the JSTL

1.5 The Need for Encapsulation

1.6 Functional Overview

1.7 JSTL Tag Libraries

1.8 Getting Ready to Use the JSTL

1.9 The Road to the JSTL

1.9.1 Dynamic vs. Static Content

1.9.2 Using Dynamic Content

1.9.3 Using Dynamic Web Features

1.9.4 Server-Side Processing

1.10 Servlets to the Rescue

1.11 Hello My Friend Servlet

1.12 JavaServer Pages

1.13 When a JSP, When a Servlet?

1.14 Evolving JSP

1.15 Custom Actions in Action

1.15.1 Why Use a Custom Action

1.15.2 Hello My Friend Using Custom Actions

1.15.3 The TLD File

1.15.4 The Tag Handler

1.16 The Power of Tag Libraries

1.16.1 Need for a Tag Library

1.17 Making Life Easier, JSTL in Action

2 JSTL Basics

2.1 Environment Setup

2.2 Using the Book Examples

2.3 JSP Scopes

2.4 JSTL Scoped Variables

2.4.1 Var and Scope Attributes

2.4.2 Variable Visibility

2.5 Dynamic and Static Attributes

2.6 Handling Errors and Exceptions

2.7 Action Body Content

2.8 Configuration Settings

2.9 The Config Class

2.10 Summary

3 Using the Expression Language

3.1 Implicit Objects Available in the EL

3.2 Accessing Data Structures

3.3 EL Operators

3.3.1 Relational Operators

3.3.2 Other Operators

3.3.3 Using Operators

3.4 Automatic Type Conversion

3.5 Default Values

3.6 Summary

4 Working with the Core Actions

4.1 Writing Output to the JspWriter

4.2 Setting Variables

4.3 Removing Variables

4.4 Using<_c3a_catch>

4.4.1 Handling Exceptions

4.5 Decisions, Decisions, Decisions-Conditional Actions

4.5.1 Simple Conditional

4.5.2 Mutually Exclusive Conditionals

4.5.3 Creating Custom Logic Actions

4.6 Handling Iterators


4.6.2 Paging through a Large Collection

4.6.3 Looping with a Collection

4.6.4 Tokenizing Data Using<_c3a_fortokens>

4.7 URL-Related Actions



4.7.3 Creating and Using Dynamic Links



4.8 Untangling the Web We Weave

4.8.1 The Power of<_c3a_import>

4.8.2<_c3a_import>and the Composite View Pattern

4.8.3 Storing Imported Content

4.8.4 Using Character Encoding

4.9 Redirecting

4.10 Summary

5 Working with the XML Actions

5.1 Overview of Supporting Technologies

5.2 eXtensible Markup Language (XML)

5.2.1 Using XML Files for Data Storage

5.2.2 XML APIs

5.3 eXtenstible Stylesheet Language (XSL)

5.3.1 Allowing for Transformation

5.3.2 XSL Languages

5.4 XML Path Language (XPath)

5.4.1 Library Functions

5.5 Variable Mappings

5.6 Using the Select Attribute

5.7 Accessing Resources

5.7.1 Node Types

5.7.2 Node Functions

5.8 eXtensible Stylesheet Language Transformation (XSLT)

5.8.1 XSLT Namespace

5.9 Parsing XML Documents


5.9.2 Filtering

5.9.3 Using the Advanced<_x3a_parse>Attributes

5.10 Using<_x3a_out>and<_x3a_set>



5.11<_x3a_set>and<_x3a_out>in Action

5.12 Using XML Documents to Determine Flow Control


5.12.2 Using<_x3a_if>

5.12.3<_x3a_choose>,<_x3a_when>, and<_x3a_otherwise>Actions

5.13 Going Loopy with<_x3a_foreach>

5.13.1 Nested forEach Loops

5.14 XML Transformation Actions


5.15 Transforming Content

5.16 Providing Parameters to Transformations


5.16.2 Performing Multiple Transformations

5.17 Summary

6 Working with the Internationalization and Formatting Actions

6.1 Locales

6.1.1 Internationalization vs. Localization

6.2 Why be Language Independent?

6.3 Localizing an Application Using Resource Bundles

6.4 Types of I18N Architectures

6.5 First, the<_fmt3a_message>Action

6.6 Localization Context

6.7 Localization Context Sample

6.8 Preferred Locales

6.8.1 Setting the Preferred Locales

6.9 Formatting Locales

6.10 How Resource Bundles are Decided

6.10.1 Resource Bundle Lookup Differences

6.11 Resource Bundle Lookup Samples

6.12 Using the LocaleSupport Class

6.13 Setting and Using Locales


6.13.2 Having a Fallback Locale

6.14 Using Messages and Resource Bundles





6.15 Setting the Resource Bundle for<_fmt3a_message>

6.16 Adding a parameter to<_fmt3a_message>

6.17 Formatting Actions

6.17.1 Determining the Time Zone



6.18 Setting and Using Time Zones

6.19 Working with Timestamps

6.20 Formatting and Parsing Timestamps



6.20.3 Customizing the Format

6.21 Using and Parsing Timestamps

6.22 Working with Numbers



6.22.3 Formatting Numbers

6.22.4 Parsing Numbers

6.23 Encoding the Client Response

6.24 Summary

7 SQL Tag Library Using the SQL Actions

7.1 The AvailableActions

7.2 Working with the Data Source


7.3 Configuring a Data Source

7.4 Using a Data Source

7.5 Maxrows Configuration Setting

7.6 Configuring and Using a Data Source

7.7 How to Modify Data


7.7.2 How to Use var with<_sql3a_update>

7.8 Interfaces and Classes

7.8.1 Result Interface

7.8.2 SQLExecutionTag Interface

7.8.3 ResultSupport Class

7.9 Finding What You Need with<_sql3a_query>


7.10 Passing Parameters to SQL Statements

7.10.1 Dealing with Date Parameters

7.11 Working with Result Sets

7.11.1 Accessing Rows and Columns

7.11.2 Using Result Set Metadata

7.12 Dealing with Transactions

7.12.1 Words of Caution


7.14 How to Use<_sql3a_transaction>

7.15 Summary

7.16 Conclusion

8 JSTL Quick Reference

8.1 Expression Language Syntax

8.1.1 Literals

8.1.2 "[]" and "." Operators

8.1.3 Arithmetic Operators

8.1.4 Relational Operators

8.1.5 Logical Operators

8.1.6 Empty Operator

8.1.7 Operator Precedence

8.1.8 Reserved Words

8.1.9 Coercion Rules

8.1.10 Accessing Named Variables

8.1.11 Implicit Objects

8.2 Configuration Settings

8.3 Core Tag Library

8.3.1 Tag Library URI

8.3.2 General Purpose Actions

8.3.3 Conditional Actions

8.3.4 Iterator Actions

8.3.5 URL Related Actions

8.4 XML Tag Library

8.4.1 Tag Library URI

8.4.2 XML Core Actions

8.4.3 XML Flow Control

8.4.4 Iterator Actions

8.4.5 Transformation Actions

8.5 SQL Tag Library

8.5.1 Tag Library URI

8.5.2 Actions

8.6 I18N Tag Library

8.6.1 Tag Library URI

8.6.2 Internationalization Actions

8.6.3 Formatting Actions