| This Chapter | |
| - | Chapter 7: JSTL |
| - | Introducing JSTL |
| - | General-Purpose Actions |
| - | Conditional Actions |
| - | Iterator Actions |
| - | Formatting Actions |
| - | Functions |
| - | Summary |
In the previous chapters the out tag of the JavaServer Pages Standard Tag Library (JSTL) was used to access scoped objects. out is only one of the many tags in JSTL. You can use JSTL for common tasks (such as iteration, collection, and conditional testing), for processing XML documents, formatting text, accessing databases and manipulating data, etc. This chapter discusses JSTL, however not every tag is covered. Rather, this chapter focuses on the tags that are directly related to Struts applications, especially those for accessing scoped objects, iterating over a collection, and formatting numbers and dates. If you are interested to know more, a complete discussion of all tags in JSTL 1.1 can be found in the JSTL Specification document.
JSTL is currently at version 1.1, which was released in June 2003. The 1.1 Specification was developed by the JSR-52 expert group under the Java Community Process (www.jcp.org). The implementation was built by the open source community under the Jakarta Taglibs project. JSTL comes in two JARs: jstl.jar and standard.jar. The specification can be found at http://java.sun.com/products/jsp/jstl/. The implementation is downloadable from http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html.
Note
At the time of writing, JSTL 1.2 is being drafted. Check this link for more information: https://jstl-spec-public.dev.java.net/.
Note
The testJSTL.jsp page in the app07a application provides examples of the tags discussed in this chapter. You can invoke it by using the following URL:
http://localhost:8080/app07a/testJSTL.do
The URL will invoke the testJSTL action that is associated with the TestJSTLAction class. The execute method of this class creates several scoped objects and you are recommended to review this class before reading the rest of the chapter.