亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

h:按鈕和h:命令按鈕的區別

h:按鈕和h:命令按鈕的區別

呼啦一陣風 2019-06-26 13:45:13
h:按鈕和h:命令按鈕的區別在JSF 2中,h:button和h:commandButton ?
查看完整描述

3 回答

?
30秒到達戰場

TA貢獻1828條經驗 獲得超6個贊

h:button-單擊h:button發書簽GET請求。

h:commandbutton-而不是GET請求h:commandbutton發出POST請求,將表單數據發送回服務器。


查看完整回答
反對 回復 2019-06-26
?
寶慕林4294392

TA貢獻2021條經驗 獲得超8個贊

h:CommandButton必須包含在h:form中,并且具有兩種導航方式,即通過設置action屬性來設置靜態導航和通過設置actionListener屬性進行動態導航,因此它更高級,如下所示:

<h:form>
    <h:commandButton action="page.xhtml" value="cmdButton"/></h:form>

此代碼生成折疊html:

<form id="j_idt7" name="j_idt7" method="post" action="/jsf/faces/index.xhtml" enctype="application/x-www-form-urlencoded">


而h:按鈕更簡單,只用于靜態或基于規則的導航,如下所示

<h:button outcome="page.xhtml" value="button"/>

生成的html是

 <title>Facelet Title</title></head><body><input type="button" onclick="window.location.href='/jsf/faces/page.xhtml'; return false;" value="button" />


查看完整回答
反對 回復 2019-06-26
  • 3 回答
  • 0 關注
  • 865 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號