Resources
Web SitesBook Reviews

Book Review: Core JSTL: Mastering the JSP Standard Tag Library

Title: Core JSTL: Mastering the JSP Standard Tag Library
Author: David M. Geary
Publisher: Prentice Hall PTR
Publish Date: November, 2002
Pages: 608
ISBN: 0-13-100153-1

Review Date: April, 2004

Ann Huffman is a Sun Certified Developer for the Java 2 Platform. She is currently employed by Magpie Telecom Insiders, developing web applications using Servlets and JSP technology along with the Struts framework.

Core JSTL by David M. Geary is a thorough, complete, and easy-to-read reference and tutorial on the Java Standard Tag Library (JSTL).  The quality of this book lives up to the reputation of the Core series from Prentice Hall.  David Geary manages to provide an easy-to-understand learning guide along with an invaluable and precise reference.  The book is designed for Java developers with a basic understanding of servlets and JSP.  However, I believe many web developers without a Java background should be able to follow most of the discussions.

The book covers all aspects of the JSTL:
  • JSTL expression language
  • Core tag library
  • Formatting tag library
  • SQL tag library
  • XML tag library
  • Tag Library Validators
The description of the tag libraries not only includes the actions (tags), but also includes a description of the JSTL classes that have been exposed to assist those who wish to implement their own custom tags.  The Tag Library Validators are a way to enforce keeping certain types of JSP features out of your JSP pages, such as JSP declarations, JSP expressions, JSP scriptlets, and/or JSP runtime expression values.

David Geary starts out in Chapter 1 with an overview of all of the aspects of JSTL.  This chapter includes the motivation and design principles behind JSTL along with a quick introduction to all of the tags which motivates the reader to want to learn more.  For readers in a hurry, this introduction is enough for them to skip right to the reference chapter at the end of the book and try out the tags for themselves.

Chapter 2 covers the JSTL expression language.  The expression language can be used in the values of the dynamic attributes of JSTL tags.  The expression language has also been incorporated into the JSP 2.0 specification.  The expression language is powerful enough to eliminate most scriptlets from JSP pages.  JSTL expressions make the JSP pages easier to read and maintain along with helping to separate presentation logic from business logic.

Chapters 3 through 10 are filled with examples using all of the tags.  The examples include screen shot sequences and complete JSP file listings along with any relevant configuration file and Java source code listings.  The part of the listings that are of interest or are being discussed are in bold text.  The fact that they are complete gives context to the discussion while the bold text aides the reader's focus to the important parts of the listing.  The examples are simple enough to understand, but complex enough to illustrate the usefulness of the tag being discussed.

The four tag libraries are broken out into seven chapters:
  • General-purpose and Conditional Actions (Core tag library)
  • Iteration Actions (Core tag library)
  • URL actions (Core tag library)
  • I18N (Internationalization) Actions (Formatting tag library)
  • Formatting Actions (Formatting tag library)
  • SQL Actions (SQL tag library)
  • XML Actions (XML tag library)
There is also a whole chapter on configuration settings which affect the actions in the Formatting and SQL tag libraries.

Internationalization, SQL and XML are deep subjects by themselves.  However, David Geary does a great job starting each of these chapters with a great introduction to each of these subjects.  These introductions give the reader enough background information to understand the discussion of the related JSTL actions.  However, the reader would probably need additional resources in order to master the usage of those JSTL actions.

Chapter 11 is the reference section for all of the actions.  The description of each action includes the syntax in an informal but clear manner, constraints and error handling, and a description of each attribute including its corresponding object type.  The reference chapter also includes the exposed classes, but these classes are better described in the earlier chapters.

The book is thoroughly cross-referenced.  There are references in the tutorial chapters to the reference chapter and from the reference chapter to the tutorial chapters.  I would love to have a soft copy version of this book with hyperlinks.

There were only a couple of small disappointments with this book.  I did notice a couple of mistakes, such as the URL to the book's web site in the preface is wrong, there is a typo in the first example of a JSTL action usage in Chapter 1, and a description for the delims attribute of the <c:forTokens> tag in the reference section is missing.  However, the quality of the rest of the book overshadows these few mistakes.  The other disappointment was that I could not bring up the book's web site, which the book promised held the source code for all of the examples in the book.  I hope that since this book is new, the web site will be forth-coming.

Some people learn best by examples.  Others learn by clear and precise descriptions.  Core JSTL provides both.  The extensive cross-referencing allows the reader to decide the path through the book.  This book is all you need to learn the Java Standard Tag Library and belongs on everyone's reference shelf.

The chapter on JSTL expressions can be viewed online at amazon.com.