Search code examples
strutsstruts-1

Cann't find ActionError class in Apache Struts 1.3.10


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?


Solution

  • Class ActionError is deprecated. Use ActionMessage class:

    errors.add("firstName", new ActionMessage("userRegistration.firstName.problem"));