Optional actionListener for h:commandButton
Here is an implementation of the needed tag handler: public final class ActionListenerHandler extends TagHandler { private final static Class[] ACTION_LISTENER_SIG = new Class[]{ActionEvent.class}; private final TagAttribute value; public ActionListenerHandler(TagConfig config) { super(config); this.value = this.getRequiredAttribute("value"); } /* * (non-Javadoc) * * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext, * javax.faces.component.UIComponent) */ public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { if (parent instanceof ActionSource2) { if (ComponentSupport.isNew(parent)) { ((ActionSource2) parent).addActionListener(new MethodExpressionActionListener( value.getMethodExpression(ctx, null, ACTION_LISTENER_SIG))); } } else { throw new TagException(thi...