h:commandbutton vs h:commandlink

后端 未结 4 612
花落未央
花落未央 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:49

    Correct me if I'm wrong but the first difference between these two is the fact, that doesn't need JavaScript to be enabled in a browser. If your webpage is JS heavy then you can use , otherwise it might be better to keep it JS free in case your user wants to use sth like Tor Browser and you are ok with it. The second one is how these two will behave in a webpage. The will just do what it is supposed to do or sometimes also fire a method from backing bean that has @PostConstruct annotation. While may also fire inline JavaScripts which may lead to firing other methods from backing bean. However it will also automatically refresh the view.

提交回复
热议问题