我定义类时
public class LoginAction extends ActionSupport 有一个这样的警告。是不是因为这个原因
The serializable class LoginAction does not declare a static final
serialVersionUID field of type long
public class LoginAction extends ActionSupport 有一个这样的警告。是不是因为这个原因
The serializable class LoginAction does not declare a static final
serialVersionUID field of type long
serialVersionUID作用:
序列化时为了保持版本的兼容性,即在版本升级时反序列化仍保持对象的唯一性。
2008-10-7 11:09:12 com.opensymphony.xwork2.validator.ActionValidatorManagerFactory <clinit>
信息: Detected AnnotationActionValidatorManager, initializing it... 也不报错
public void validate()
{
System.out.println("=======1 你进入了heilwolf重写的验证器!");
if(null == this.getUsername() || "".equals(this.getUsername().trim()))
{
System.out.println("=======1 getUsername ");
this.addFieldError("username", "username required");
System.out.println("=======2 getUsername ");
}
System.out.println("=======2 你进入了heilwolf重写的验证器!");
if(null == this.getPassword() || "".equals(this.getPassword().trim()))
{
System.out.println("=======1 getPassword");
this.addFieldError("password", "password required");
System.out.println("=======2 getPassword");
}
System.out.println("=======3 你进入了heilwolf重写的验证器!");
}
晕死,低级错误。。addFieldError中的fieldName写错。struts也不报错