Chapter 2. The JSTL Expression Language

   

Topics in This Chapter

  • Expression Language Overview

  • Expressions

  • Identifiers

  • Operators

  • Type Coercion

  • Literal Values

  • Implicit Objects

  • Method Invocation

  • EL Expressions in Custom Actions

  • Common Mistakes

Although JSTL, as its name implies, provides a set of standard tags, its single most important feature may well be the expression language it defines. That expression language greatly reduces the need for specifying tag attribute values with Java code and significantly simplifies accessing all sorts of application data, including beans, arrays, lists, maps, cookies, request parameters and headers, context initialization parameters, and so on. In fact, the JSTL expression language adds so much value to JSP that it will be incorporated into JSP 2.0. [1]

[1] The JSP expert group will do everything possible to ensure that the JSP 2.0 expression language is backward-compatible with the JSTL 1.0 expression language.

This chapter examines the JSTL expression language in detail, starting with expressions and identifiers and ending with sections on using the expression language for custom action attributes and common mistakes that developers make when using the expression language.

Note

To illustrate the JSTL expression language, this chapter uses a number of JSTL actions, such as <c:out>, <c:if>, and <c:forEach>, that have not yet been formally discussed in this book. However, the use of those actions is intuitive and this chapter does not use any of those action's advanced features. See Chapter 3, "General-Purpose and Conditional Actions," and "Iteration Actions" on page 150 for formal discussions of the actions used throughout this chapter.


   


Core JSTL[c] Mastering the JSP Standard Tag Library
Core JSTL[c] Mastering the JSP Standard Tag Library
ISBN: 131001531
EAN: N/A
Year: 2005
Pages: 124

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net