Thursday, July 26, 2012

How to use the submit ajax tag with Struts2



first you have to include the ajax tag library 

<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

second, define the submit ajax component
<sj:submit  targets="yourTargetDiv/Form"   title="Submit"
effect="pulsate" effectOptions="{ color : '#222222' }" effectDuration="500" />

Third, add the action to the form that contains this <sj:submit>

-----
after you click the <sj:submit> , This test.jsp will be viewed in the target defined in the <sj:submit>:

<action name="actionTest" method="test" class="com.QueryAction">
<result name="success">/jsp/test.jsp</result>
</action>

No comments:

Post a Comment