Hi everybody
I dont see an error in my jsp when I dont fill in a textfield. I use struts 1.2
Then next code checks for empty fields in my form class
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (name == null || "".equalsIgnoreCase(name)) {
errors.add("name", new ActionMessage("geen naam ingevuld"));
}
if (description == null || "".equalsIgnoreCase(description)){
errors.add("description", new ActionMessage("geen omschrijving ingevuld"));
}
if (errors.size() != 0) {
return errors;
}
return null;
}
In my jsp I try to retrieve the error using the following code
<td><html:errors property="description" /></td>
I am using struts 1.2 and since 1.2 ActionError is deprecated, So I use ActionMessage instead as recommended. Does anybody know if this is the cause and what I have to add or change to make the error displaying work?
Kind regards, Jarno