background image

Using JSTL

<< The display-name Element | Tag Collaboration >>
<< The display-name Element | Tag Collaboration >>

Using JSTL

See
"Troubleshooting Duke's Bookstore Database Problems" on page 102
for help with
diagnosing common problems.
Using JSTL
JSTL includes a wide variety of tags that fit into discrete functional areas. To reflect this, as well
as to give each area its own namespace, JSTL is exposed as multiple tag libraries. The URIs for
the libraries are as follows:
Core
:
http://java.sun.com/jsp/jstl/core
XML
:
http://java.sun.com/jsp/jstl/xml
Internationalization
:
http://java.sun.com/jsp/jstl/fmt
SQL
:
http://java.sun.com/jsp/jstl/sql
Functions
:
http://java.sun.com/jsp/jstl/functions
Table 7­1
summarizes these functional areas along with the prefixes used in this tutorial.
TABLE 7­1
JSTL Tags
Area
Subfunction
Prefix
Core
Variable support
c
Flow control
URL management
Miscellaneous
XML
Core
x
Flow control
Transformation
I18N
Locale
fmt
Message formatting
Number and date formatting
Database
SQL
sql
Functions
Collection length
fn
String manipulation
Thus, the tutorial references the JSTL core tags in JSP pages by using the following taglib
directive:
<%@ taglib uri=
"http://java.sun.com/jsp/jstl/core" prefix="c" %>
Using JSTL
Chapter 7 · JavaServer Pages Standard Tag Library
203