我按照JakataStruts live
(2004)一书中的教程进行操作。我有代码片段:
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(firstName == null || firstName.trim().equals("")){
errors.add("firstName", new ActionError("userRegistration.firstName.problem"));
}
//...
return errors;
Netbeans IDE注意到:"找不到符号"。如何解决上述问题?
答案 0 :(得分:3)
不推荐使用类ActionError
。使用ActionMessage
类:
errors.add("firstName", new ActionMessage("userRegistration.firstName.problem"));