How to get <s:button> functionality in Struts2?
<s:form action="XYZ" method="post">
    <s:textfield name="sno" />
    <s:textarea name="t" rows="2" cols="4" />
    <!-- Here i want a button lets say -->
    <s:button value="GET TEXT" />
    <!--
        which executes other action (not "XYZ" ) and fill the textarea based on the serial no value(sno). 
    -->
    <s:submit  value="submit" />
</s:form> 
Table
sno text
1 "hsdjhjjsh" 2 "jsdjh hj kjskjdhj"
When su开发者_开发知识库bmit the form it should insert a new row. Action "XYZ" does that.
But when i give existing sno lets say "1" and onclick GET TEXT button it should not submit form it but should call other action which will fill the textarea with hsdjhjjsh.
Thanks
Can't you use plain HTML: input type button?
If you don't want to submit, it probably does not need any struts functionality.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论