如何在JSF Framework中使用li和ul标签? [英] How to use li and ul tag in JSF Framework?
本文介绍了如何在JSF Framework中使用li和ul标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在JSF Framework中使用li和ul标签?
How to use li and ul tag in JSF Framework?
推荐答案
您可以将标准html与JSF语法混合使用.只需写
You can use standard html mixed with JSF syntax. Just write
<ul>
<li> Apple </li>
<li> Banana </li>
</ul>
我想您要显示的是List
如果您使用的是Facelets,请执行以下操作:
If you are using Facelets, do:
<ul>
<ui:repeat value="#{myBean.items}" var="item">
<li><h:outputText value="#{item.name}"/></li>
</ui:repeat>
</ul>
如果不是,则应该.无论如何,您可以使用旧的JSTL和c:forEach
If you are not, you should. Anyway, you can do the same with the old JSTL and c:forEach
<html ... xmlns:c="http://java.sun.com/jstl/core">
...
<ul>
<c:forEach items="#{myBean.items}" var="item">
<li><h:outputText value="#{item.name}"/></li>
</c:forEach>
</ul>
这篇关于如何在JSF Framework中使用li和ul标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文