In my JSF 2.1 project, I have a custom facelet tag file that defines an actionListener using the solution provided in Passing backing bean action to Facelet tag file .
The problem is, I'd like to have the option of not having the actionListener when using the tag, and that solution makes the action attribute required. I'd rather not have to create two versions of the tag (with and without actionListener) just for this, because the code is relatively large, and that would impose some maintenance trouble.
What should I do to conditionally add the actionListener in the tag implementation, without Java coding (if that is even possible)?