我有一個HTML形式的多個按鈕,但我需要在struts僅執行單一按鈕動作等按鈕不要去execute()方法1.3如何執行單一的Struts表單提交行動
如:
button1: connect
button2 : disconnect
button3 :save
我只需要執行保存按鈕操作會去支柱execute()方法別人也不會去
在此先感謝
我有一個HTML形式的多個按鈕,但我需要在struts僅執行單一按鈕動作等按鈕不要去execute()方法1.3如何執行單一的Struts表單提交行動
如:
button1: connect
button2 : disconnect
button3 :save
我只需要執行保存按鈕操作會去支柱execute()方法別人也不會去
在此先感謝
讓Button1的和BUTTON2簡單的按鈕,使BUTTON3作爲提交按鈕
<button type="button" onclick="connect()">Button1</button>
<button type="button" onclick="disconnect()">Button2</button>
<input type="submit" value="button3">
擴展你的行動的DispatchAction併爲每個按鈕創建http://struts.apache.org/development/1.x/struts-extras/apidocs/org/apache/struts/actions/DispatchAction.html
OR
使用<input type="button">
前2個按鈕和submit
爲BUTTON3 3種不同的方法。
nd因此點擊這些按鈕不要提交表單到服務器,直到你寫入onclick()事件,但第三個是通過點擊提交請求提交按鈕發送到服務器automayically到在行動中給出的資源屬性在標籤中。
<input type="button" value="connect"/>
<input type="button" value="disconnect"/>
<input type="submit" value="save"/>