我如何在JSF 2.0中使用EL中的参数/变量/参数调用直接方法或方法?
例如,在EL中获取列表大小:
<h:outputText value="#{bean.list.size()}" />
Run Code Online (Sandbox Code Playgroud)
或者使用参数调用action方法:
<h:commandButton value="edit" action="#{bean.edit(item)}" />
Run Code Online (Sandbox Code Playgroud)
这在我的环境中似乎不起作用.它似乎不喜欢括号.
javax.el.ELException:错误解析:#{bean.list.size()}
com.sun.el.parser.ParseException:遇到"("
我已经阅读了有关通过actionListener将参数从jsf页面传递给managedbean的信息.是否也可以将参数传递给简单的操作方法?
谢谢你的阅读......
谢谢你们的建议!没有你我会迷路的:-)
以下为我工作:
<h:commandLink id="link" action="#{overviewController.showDetails}" >
<f:setPropertyActionListener target="#{overviewController.show_id}" value="#{project.id}" />
<h:outputText value="#{project.title}" />
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
那么现在谁值得绿色蜱?:-P我可以给他们两个吗?
我是JSF 2.0的新手.在最后一个版本中,我理解如果我想要更改关于"发送给客户端的内容"的规则,我只需要配置faces-config.xml.
现在,在2.0版本上,如何管理Action?例如,如果我在index.xhtml上有这个
<h:commandButton id="submit" value="submit" action="response" />
Run Code Online (Sandbox Code Playgroud)
我需要调用一个名为response.html(不是xhtml)的页面,或者将该页面放入/folder/response.html或其他东西?怎么办?我知道JSF 2.0对这些事情非常灵活(href链接的概念被打败).所以我认为我可以用其他方法来管理这个,对吧?