如何从JSF 2.0 Facelets模板调用List.size()?
问题描述:
在JSF 2.0 Facelets模板中调用list.size()的语法是什么(例如,使用h:outputText元素)?
What is the syntax for calling list.size() in a JSF 2.0 Facelets template (eg, using an h:outputText element)?
答
这是怎么回事:
<h:outputText value="#{fn:length(someBean.someList)}" />
您需要在JSF页面(URI:http://java.sun.com/jsp/jstl/functions
)中引用functions
标签库.
You'll need to reference the functions
taglib in your JSF page (URI: http://java.sun.com/jsp/jstl/functions
).