官术网_书友最值得收藏!

Form submission

<h:commandButton> renders an HTML submit button in the browser. Just like with standard HTML, its purpose is to submit the form. Its value attribute simply sets the button's label. This tag's action attribute is used for navigation; the next page to show is based on the value of this attribute. The action attribute can have a String constant or a method binding expression, meaning that it can point to a method in a named bean that returns a string.

If the base name of a page in our application matches the value of the action attribute of a <h:commandButton> tag, then we navigate to this page when clicking the button. This JSF feature frees us from having to define navigation rules, like we used to have to do in older versions of JSF. In our example, our confirmation page is called confirmation.xhtml; therefore by convention, this page will be shown when the button is clicked, since the value of its action attribute (confirmation) matches the base name of the page.

Even though the label for the button reads Save, in our simple example, clicking on the button won't actually save any data.

主站蜘蛛池模板: 石门县| 桐庐县| 巴林右旗| 藁城市| 钟山县| 丰原市| 吴江市| 隆安县| 北流市| 甘肃省| 尉犁县| 三河市| 峨山| 丰宁| 乌苏市| 泾源县| 且末县| 城固县| 佛坪县| 营山县| 伊川县| 平度市| 大兴区| 平定县| 天水市| 陆丰市| 汾西县| 易门县| 郎溪县| 长阳| 台前县| 乌鲁木齐县| 江川县| 左云县| 石首市| 宁晋县| 沂源县| 北海市| 莱西市| 瑞丽市| 西和县|