O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. JavaServer Faces Tag Libraries

The JavaServer Faces API includes two JSP tag libraries that are used to create the user interface for your applications. The JSF tag library is divided into two parts. The HTML tag library provides tags to produce HTML output, and the core tag library provides utilities that are not specific to the HTML rendering model.

JSF Core Tags

The JSF core tags provide access to all of the JSF features that do not directly relate to HTML rendering. Many of the HTML tags rely on core tags to specify optional features, such as validation functionality.

To use the JSF core tags in a JSP file, you must include the following statement in the file header:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

Use of f as the tag namespace prefix is both conventional and highly recommended but not required.

<f:actionListener>

Adds an action listener implementation to the surrounding UIComponent tag, such as an <h:commandLink>. The tag must specify the fully qualified class name of a class implementing the javax.faces.event.ActionListener interface. If you wish to handle action events via a method on a backing bean, use the appropriate attribute on the UI component tag instead.

Table B-1. Attribute for <f:actionListener>

Attribution

Description

type

The fully qualified class name of a class that implements the ActionListener interface

<f:attribute>

Adds an attribute to the surrounding tag. Using this tag is functionally equivalent to setting the attribute value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required