我怎么能传递一个Array一个Bean在JSF。
例:
豆角,扁豆:
@ManagedBean(name="bean")
...
/* Method I want to call*/
public String output(String[] strings) {
...
}
JSF:
<h:outputText value="#{bean.output( ??? )}"/>
您不能创建在EL一个数组,但你可以创建一个字符串与特定的分隔符,然后用JSTL fn:split()
到它的分隔符分成数组。
<html ... xmlns:fn="http://java.sun.com/jsp/jstl/functions">
...
<h:outputText value="#{bean.output(fn:split('one,two,three', ','))}" />