<form-bean name="RegisterForm" type="com.mysite.form.RegisterForm" />
<action path="/register" type="com.mysite.action.RegisterAction" name="RegisterForm" input="/register.jsp" validate="true">
<forward name="success" path="/welcome.jsp" />
<forward name="failure" path="/register.jsp" />
</action>
注册表格
public class RegisterForm extends ActionForm{
private String name;
/**
Constructor
Set+Get
**/
public ActionErrors validate(ActionMapping mapping, ServletRequest request) {
ActionErrors errorList = new ActionErrors();
System.out.println("VALIDATING");
return errorList;
}
}
这就是我所拥有的。由于某种原因,控制流似乎直接跳转到 ActionForm 的执行方法,因为我什至在控制台中都看不到 VALIDATING 消息。有什么我想念的吗?谢谢!