Hi,

i have this code when i get a error

        if( person.getNumId() == null || person.getNumId().trim().length() <
9 ) {
            String[] pars = {"8"};
            this.addFieldError( "field.doc" , this.getText(
"error.val.minlength" , pars ) );
        }

where "field.doc" it is a key with a string associate in a resource file:

field.doc=Identification.

In my errors.properties file i have a error description by
"error.val.minlength":

error.val.minlength=Needs to be {0} characters long at least, for
"${getText(fieldName)}"

but in my pages i get: Needs to be 8 characters long at least, for "".

Why can not i get the string "Identification" associated with the string
"field.doc"?

In the other hand, if i put the validation into xml file like:

     <field name="doc">
        <field-validator type="stringlength">
            8
            true
            <message key="error.val.minlength"/>
        </field-validator>
    </field>

i get: "Needs to be {0} characters long at least, for ""

How can I associated this validation with the key "field.doc" by get
"Identification" througth ${getText(fieldName)} if my field name for this
textfield it is different that key associated it?, and how can i get the
param 8 from this xml sintax?

Sorry for my english, thanks a lot for your help.
-- 
View this message in context: 
http://www.nabble.com/-S2--problems-with-validations-tp15214068p15214068.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to