O'Reilly logo

JSF 1.2 Components by Ian Hlavats

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

Iterating data in a Facelets page

The JSTL tag library includes a<c:forEach> tag that supports iterating dynamic data. While Facelets supports a subset of the JSTL, it provides the<ui:repeat> tag as an alternative to the JSTL<c:forEach> tag for data iteration. The following example demonstrates how to render an unordered list of customers using the Facelets<ui:repeat> tag and plain HTML tags:

repeat01.jsf

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html xmlns=http://www.w3.org/1999/xhtml xmlns:h=http://java.sun.com/jsf/html xmlns:ui=http://java.sun.com/jsf/facelets> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ui:repeat example</title> ...

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