invoke javax.el.MethodExpression from jsf component

I have a jsp tag wich 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?

Answers


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}.


Need Your Help

Center align images in ListView (Compact Framework)

c# windows-mobile compact-framework windows-mobile-6.5

I am working on a mobile application where the main menu is created by a ListView. I have the following as my screen now:

a href refers to site itself + link instead of the link itself

php html codeigniter hyperlink href

In Codeigniter, I have a database containing a link of a site.