Skip to Content
Java Servlet & JSP Cookbook
book

Java Servlet & JSP Cookbook

by Bruce W. Perry
January 2004
Intermediate to advanced
746 pages
45h 46m
English
O'Reilly Media, Inc.
Content preview from Java Servlet & JSP Cookbook

Chapter 23. Using the JSTL

Introduction

JavaServer Page’s custom tags and tag handlers are designed to help you invent your own tags. While this is a powerful tool for Java web developers, developing custom tags entails a steep learning curve and can be time consuming. Luckily, some hard-working volunteer software developers have developed a bunch of highly useful tags for you. This tag collection is called the JavaServer Pages Standard Tag Library (JSTL). The JSTL specification arises from the Java Community Process (JSR-052) and the Apache Jakarta Project has developed a JSTL implementation, the Standard 1.0 taglib.

The JSTL has very broad functionality. It includes tags that:

  1. Set object attributes for web applications (c:set ).

  2. Output text to web pages (c:out and x:out).

  3. Iterate over collections of data (c:forEach and x:forEach).

  4. Format numbers, dates, and currencies using different international styles (e.g., fmt:formatDate, fmt:formatNumber).

  5. Transform XML (x:transform ).

  6. Interact with databases using SQL (e.g., sql:query, sql:update).

  7. Allow you to embed function calls in JSP code and template text (e.g., fn:substring( )). This functionality is available only with JSP 2.0 and JSTL 1.1 (see Recipe 23.14).

The JSTL originated a very important new JSP technology, the Expression Language (EL). This is a scripting language based generally on JavaScript and other scripting tools that, with JSP 2.0, can be embedded in HTML template text.

Tip

The EL was once part of JSTL 1.0 but ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java Servlet Programming

Java Servlet Programming

Jason Hunter
Java Servlet Programming, 2nd Edition

Java Servlet Programming, 2nd Edition

Jason Hunter, William Crawford

Publisher Resources

ISBN: 0596005725Errata Page