struts2-action-validate()验证
package com.test.action;import java.util.Date;import com.opensymphony.xwork2.ActionSupport;public class RegisterAction extends ActionSupport {private int age ;public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String execute() throws Exception{System.out.println("execute()") ;return SUCCESS ;}public void validate() {System.out.println("hello world") ;}}?先调用set()方法,然后调用validate()方法,没用错误就调用execute()方法,否则不调用!?
?
?
?
?
?
?
?
?
?