开发者

Component which can take a collection and render it without any markup

Is there a JSF component which can take a collection of items and render it the way I want? Like a h:data开发者_高级运维Table, but then without the markup of a HTML <table>.


If you're using Facelets, use <ui:repeat>.

<html xmlns:ui="http://java.sun.com/jsf/facelets">
...
<ui:repeat value="#{bean.list}" var="item">
    #{item}<br />
<ui:repeat>

Or when you're still on legacy JSP, use JSTL <c:forEach>.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
...
<c:forEach items="#{bean.list}" var="item">
    #{item}<br />
</c:forEach>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜