Difference between h:button and h:commandButton

前端 未结 5 1680
轮回少年
轮回少年 2020-11-22 06:26

In JSF 2, what is the difference between h:button and h:commandButton ?

5条回答
  •  青春惊慌失措
    2020-11-22 06:58

    Here is what the JSF javadocs have to say about the commandButton action attribute:

    MethodExpression representing the application action to invoke when this component is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns an Object (the toString() of which is called to derive the logical outcome) which is passed to the NavigationHandler for this application.

    It would be illuminating to me if anyone can explain what that has to do with any of the answers on this page. It seems pretty clear that action refers to some page's filename and not a method.

提交回复
热议问题