关于使用validate方法的出错的问题
请教各位大侠
在FORMBEAN里加入这样的代码
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
if(userName == null || userName.equals("") )
{
System.out.println("aaa");
errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage("error.userName.required"));
System.out.println("bbb");
}
return errors;
}
后会报错误
2006-8-1 11:57:38 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: org.apache.struts.action.ActionMessage
调试了半天如果把errors.add这个方法注释掉就没错误了 偶现在想知道偶写的那里有问题了
是不是资源文件写的不对或是其他什么原因?