Difference between h:button and h:commandButton

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

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

5条回答
  •  天命终不由人
    2020-11-22 06:50

    h:commandButton must be enclosed in a h:form and has the two ways of navigation i.e. static by setting the action attribute and dynamic by setting the actionListener attribute hence it is more advanced as follows:

    
        
    
    

    this code generates the follwing html:

    whereas the h:button is simpler and just used for static or rule based navigation as follows

    
    

    the generated html is

     Facelet Title
    

提交回复
热议问题