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:
<!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> </head> <body> <h:form> <ul> <ui:repeat value="#{customerBean.customerList}" var="customer"> <li>#{customer.fullName}</li> </ui:repeat...