First you need DWR servlet (Uk.ltd.getahead.dwr.DWRServlet) Dojo and Ajax theme, where DWR is used for normal validation dojo to handle Ajax effects.
Next, configure DWR, write Dwr.xml, and store it under web-inf/. The contents are as follows
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="validator">
<param name="class" value="org.apache.struts2.validators.DWRValidator"/>
</create>
<convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
</allow>
<signatures>
<![CDATA[
import java.util.Map;
import org.apache.struts2.validators.DWRValidator;
DWRValidator.doPost(String, String, Map<String, String>);
]]>
</signatures>
</dwr>
Then you need to configure it to the Web program and add the following configuration code to Web.xml:
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
Finally, I modified the JSP file in my "struts2 form verification" article edit.jsp
With Ajax theme in the Head, form form joins validate= "true" Theme= "Ajax" and can now run experience ajax effects.