h:commandbutton vs h:commandlink

后端 未结 4 611
花落未央
花落未央 2020-12-30 03:58

We are using JSF-2.1.7 and in all our form post requests. I am trying to justify whether to use or .

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 04:39

    For a form, I prefer the h:commandbutton

    h:commandbutton is like a button in HTML where you can set the action of a backing bean. h:commandlink is like a link in HTML (the tag a) where you also can set the action of a backing bean

    To use the css style in JSF, you can use the attribute 'styleClass'.

提交回复
热议问题