3

I follow the tutorial in book JakataStruts live (2004). I have code snippet:

@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 notice that: "Cannot find symbol". How to resolve the above problem?

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
Vy Do
  • 46,709
  • 59
  • 215
  • 313

1 Answers1

5

Class ActionError is deprecated. Use ActionMessage class:

errors.add("firstName", new ActionMessage("userRegistration.firstName.problem"));
Vy Do
  • 46,709
  • 59
  • 215
  • 313