The JSP Standard Tag Library (JSTL)

The intent of the early JSP specification group members was to define a set of standard JSP tags within the specification. This would allow vendors to generate their own versions of the standard tags but also allow developers to count on this set of standard tags to be available in all compliant containers. However, due to time constraints, that feature of the early JSP specification was not included.

Since then, many vendors have created their own versions of commonly used tag libraries, but these versions are different enough that developers can’t easily port their JSP pages from one container to another without having to modify the pages. JSR 52, the JSP Standard Tag Library (JSTL), aims to fix that problem.

JSR 52 defines a set of standard tags that should be present in any compliant container. The second version of the specification has been finalized and approved, and the group has released a reference implementation of the tag library.

The tags provided in the first release can be grouped into five distinct areas:

  • Core tags

  • Internationalization tags

  • XML tags

  • SQL tags

  • Functions

JSTL Core Tags

The core tags include those related to expressions, flow control, and a generic way to access URL-based resources whose content can then be included or processed within the JSP page. They include tags such as if, forEach, import, redirect, and many more.

JSTL Internationalization Tags

The internationalization tags are divided into two groups: messaging and ...

Get Programming Jakarta Struts, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.