【发布时间】:2015-01-26 17:35:30
【问题描述】:
我用 commandLink 创建了一个模板:
<div class="pull-right" style="padding: 5px">
<h:commandLink action="#{urlVoltar}" styleClass="btn btn-sm btn-danger"><span class="fa fa-reply"></span></h:commandLink>
</div>
并在主页中使用它:
<ui:include src="/sistema/commonBotoesExportar.xhtml">
<ui:param name="urlVoltar" value="\indexNovo.xhtml" />
</ui:include>
所以当我点击按钮时,我得到了这个异常:
javax.faces.el.EvaluationException: javax.el.ELException: //C:/project/WebContent/sistema/commonBotoesExportar.xhtml @13,154 action="#{urlVoltar}": Identity 'urlVoltar' does not reference a MethodExpression instance, returned type: java.lang.String
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
...
我需要做些什么来解决这个问题。谢谢
【问题讨论】: