I use commons-validator v1.2 specification-version : 1.0 whereas my spec-version for struts is : 1.1. Although everything works fine except the message display in the alert box. The alert box display case are relevant.
By instance this jsp field :
<td class="RechBlocCiel">
<input name="nom" type="text" class="inputForm" size="2" maxlength="50" />
</td>
I put in validation.xml :
<field property="nom" depends="required">
<msg name="required" key="error.nom" />
</field>
related to
<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
msg="errors.required" />
and in struts config the plugin is declared :
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
<message-resources
parameter="xxx.resources.ApplicationResources" />
In xxx.resources.ApplicationResources I have the properties file : ApplicationResources.properties which contains:
errors.required = <li> Le champ [{0}] est obligatoire.</li>
error.nom = nom
It seems to me that everything is complete, so I'm not sure where to search now, except in a problem of version between validator and struts. I 'm looking for the message : "Le champ nom est obligatoire."