What's the difference between actionListener and action ? When to use one or the other?
<h:commandButton action="xxxx" actionListener="zzzz" id="teste"/>
What's the difference between actionListener and action ? When to use one or the other?
<h:commandButton action="xxxx" actionListener="zzzz" id="teste"/>
Although you can use them in the same way (perform actions), I think the best question is "when" to use one in spite of another.
Action
You should use an action if you intend to run business logic or navigate between pages . The action method can return a String indicating the navigation rule.
ActionListener
You should use an actionListener if what you want to do is execute a view-related logic or trigger an action before a business logic. The logic invoked by an actionListener is more closely linked to details of the screen than purely business rules.
Not to be in the 'spool', link