Book Image

Java EE 5 Development with NetBeans 6

Book Image

Java EE 5 Development with NetBeans 6

Overview of this book

Table of Contents (17 chapters)
Java EE 5 Development with NetBeans 6
Credits
About the Author
About the Reviewers
Preface
Identifying Performance Issues with NetBeans Profiler

Core JSTL Tags


NetBeans allows us to easily use three core JSTL tags, the <c:if> tag used to conditionally render segments of a page; the <c:choose> tag, which allows us to render part of a page differently based on a boolean condition; and the <c:forEach> tag, which allows us to iterate through an instance of a class implementing java.util.Collection or through an array. These tags can be dragged from the NetBeans palette into our page.

Before we can use core JSTL tags, we need to add a taglib directive to our page. The taglib directive tells our JSP that we will be using custom tags in the page. For core JSTL tags, the taglib directive looks like this:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

The value of the prefix attribute is the prefix to be used before any tags in the tag library. By convention, the prefix of c is used for JSTL core tags. The value of the uri attribute is a Unique Resource Identifier that will let our page know where to...