How to correctly use alternate messages in the Struts validation framework.

Based on the following information from Programming Jakarta Struts
Chapter 11 The Validator Framework

Programming Jakarta Struts - Chuck Cavaness - Google Books



“You should add these to your application’s resource bundle, or change the key values in the validation-rules.xml if you plan to use alternative messages.”

I have the following code in validator-rules.xml file.

<validator name="required"
classname="StrutsValidators"
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.new"/>

<validator name="mask"
classname=" StrutsValidators"
method="validateMask"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.invalid.new"/>


I added the following string to the properties file.

errors.required.new={0} is required NEW!!!
errors.invalid.new={0} is not valid NEW!!!.


My validation.xml file looks like this:

<field property="attribute(Number)" depends="required,mask,maxbytelength,nonce">
<msg name="required" key="errors.required" />
<msg name="maxbytelength" key="errors.maxlength" />
<var>
<var-name>maxbytelength</var-name>
<var-value>32</var-value>
</var>
<var>
<var-name>form</var-name>
<var-value>Info</var-value>
</var>
<msg name="mask" bundle="mytest"key="errors.invalid" />
<arg0 key="label.Number" />
<var>
<var-name>mask</var-name>
<var-value>^[0-9\-() ]*$</var-value>
</var>
</field>

I still see the standard error messages such as the ones listed below displayed on the UI.
errors.required.new={0} is required.
errors.invalid.new={0} is not valid.

Is this a Struts bug? If not, what is the right way to use alternate validation message in this case?

Thanks a lot.