Skip to Content
Head First Servlets and JSP, 2nd Edition
book

Head First Servlets and JSP, 2nd Edition

by Bryan Basham, Kathy Sierra, Bert Bates
March 2008
Intermediate to advanced
911 pages
20h 31m
English
O'Reilly Media, Inc.
Content preview from Head First Servlets and JSP, 2nd Edition

What if you need a tag that’s NOT in JSTL?

The JSTL is huge. Version 1.1 has five libraries—four with custom tags, and one with a bunch of functions for String manipulation. The tags we cover in this book (which happen to be the ones you’re expected to know for the exam) are for the generic things you’re most likely to need, but it’s possible that between all five libraries, you’ll find everything you might ever need. On the next page, we’ll start looking at what happens when the tags below aren’t enough.

Note

The “Core” library

General-purpose

<c:out>
<c:set>
<c:remove>
<c:catch>

Conditional

<c:if>
<c:choose>
<c:when>
<c:otherwise>

URL related

<c:import>
<c:url>
<c:redirect>
<c:param>

Iteration

<c:forEach>
<c:forTokens>

We didn’t cover this one... it lets you iterate over tokens where YOU give it the delimiter. Works a lot like StringTokenizer. We also didn’t cover <c:redirect>, but that gives you a wonderful excuse to get the JSTL docs.

The “Formatting” library

Internationalization

<fmt:message>
<fmt:setLocale>
<fmt:bundle>
<fmt:setBundle>
<fmt:param>
<fmt:requestEncoding>

Formatting

<fmt:timeZone>
<fmt:setTimeZone>
<fmt:formatNumber>
<fmt:parseNumber>
<fmt:parseDate>

The “SQL” library

Database access

<sql:query>
<sql:update>
<sql:setDataSource>
<sql:param>
<sql:dateParam>

The “XML” library

Core XML actions

<x:parse>
<x:out>
<x:set>

XML flow control

<x:if>
<x:choose>
<x:when>
<x:otherwise>
<x:forEach>

Transform actions

<x:transform>
<x:param>

Relax

Only the “core” library is covered on the exam.

The “core” ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Java, 2nd Edition

Head First Java, 2nd Edition

Kathy Sierra, Bert Bates
Head First Java, 3rd Edition

Head First Java, 3rd Edition

Kathy Sierra, Bert Bates, Trisha Gee
Learning Java, 6th Edition

Learning Java, 6th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 9780596516680Errata PageSupplemental Content