[ Team LiB ] Previous Section Next Section

Hour 15. The JSP Expression Language

What You'll Learn in This Hour:

  • What the JSP Expression Language is

  • How to reference variables and literal values

  • How to use various implicit objects

  • How to invoke functions

In the previous hour, you learned about the <jsp:useBean> tag. With the power of built-in tags like <jsp:useBean> and additional custom tag libraries (which you'll learn about in the next few hours), you can write powerful JSPs that contain no scriptlets—only tags. One of the original limitations of the <jsp:useBean> tag and its associated tags is that they could only access simple bean attributes. If the attribute was a collection, you couldn't access individual elements in the collection.

The JSP Expression Language (EL) addresses this limitation by defining an expression syntax that lets you manipulate collections and other complex data structures from within JSP tags. The JavaServer Pages Standard Tag Library (JSTL) also defines a set of operators so you can write simple expressions, and a function syntax so you can invoke utility functions. When coupled with custom tag libraries, the JSP EL becomes a very powerful alternative to scriptlets.

    [ Team LiB ] Previous Section Next Section