在Struts1.2中ActionErrors的add是Deprecated,请看Struts的javadoc,
public void add(java.lang.String property,ActionError error)
Deprecated. Use add(String, ActionMessage) instead. This will be removed after Struts 1.2.
public void add(java.lang.String property,ActionError error)
Deprecated. Use add(String, ActionMessage) instead. This will be removed after Struts 1.2.
errors.add("username",new ActionError("error.username.required"));这样就能在表单中用
<html:errors/>