Vy Do
Vy Do

Reputation: 52656

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?

Upvotes: 3

Views: 2337

Answers (1)

Vy Do
Vy Do

Reputation: 52656

Class ActionError is deprecated. Use ActionMessage class:

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

Upvotes: 6

Related Questions