user2444474 user2444474 - 1 year ago 208
Java Question

Struts2 jQuery plugin - submit button

I have Struts2 jQuery plugin submit button, when click the button its not firing the action class as struts submit button. I need to keep the same page after click the button.Please look into below code difference.

Struts submit button - Working good

<s:form action="product!list" id="searchForm" theme="simple" method="Post">
<s:submit action="product" method="list" value="Find" />

Converting struts submit to struts-jquery submit submit button - Not Working good

<s:form action="product!list" id="searchForm" theme="simple" method="Post" >
<sj:submit />

if using only form action
, the page the refreshing and working as Struts tag, but it should not be.

Answer Source

In order <sj:submit> to work properly targets attribute must be set to some value and form must have id attribute.

<s:form action="product!list" id="searchForm">     
  <sj:submit targets="results"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download