开发者

invoke javax.el.MethodExpression from jsf component

开发者 https://www.devze.com 2022-12-25 07:31 出处:网络
I have a jsp tag which takes a javax.el.MethodExpression as attribute: <%@ attribute name="action" required="true" type="javax.el.MethodExpression" rtexprvalue="t

I have a jsp tag which takes a javax.el.MethodExpression as attribute:

<%@ attribute name="action" required="true" type="javax.el.MethodExpression" rtexprvalue="true" %>

within the same tag I have:

<h:commandLink action="开发者_高级运维;#{action}">
    link text
</h:commandLink>

I'm getting the following error when I try to click the link:

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

is it possible for the commandLink to properly invoke the "action" method?


Don't create a JSP tag. Create a JSF component. Extend UIComponentELTag. Tutorials here.

Or, if you're using Facelets, consider a template using ui:composition. Tutorials here.

Or, if you're already on JSF 2.0, you can get a step further with composite components. Tutorial here.


It's been a while since I did JSF, but I'm pretty sure a method expression is of the form: #{bean.method}. You can't just say #{method}.

0

精彩评论

暂无评论...
验证码 换一张
取 消