我有一个 jsp 标记,它采用 javax.el.MethodExpression 作为属性:
<%@ attribute name="action" required="true" type="javax.el.MethodExpression" rtexprvalue="true" %>
在我拥有的同一标签内:
<h:commandLink action="#{action}">
link text
</h:commandLink>
当我尝试单击该链接时收到以下错误:
javax.faces.FacesException: #{action}: org.apache.jasper.el.JspMethodNotFoundException: /WEB-INF/tags/pager/pager.tag(17,1) '#{action}' Identity 'action' was null and was unable to invoke
commandLink 是否可以正确调用“action”方法?
最佳答案
不要创建 JSP 标记。创建一个 JSF 组件。延长UIComponentELTag
。 Tutorials here .
或者,如果您使用 Facelets,请考虑 template使用ui:composition
。 Tutorials here 。
或者,如果您已经使用 JSF 2.0,则可以使用 composite components 更进一步。 。 Tutorial here .
关于java - 从 jsf 组件调用 javax.el.MethodExpression,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2547779/