Hi all,

With Struts 2.0.6, I try to have validation message with localization.

For example, I have a "login" form, with a "loginInput" input text :
<s:form action="login" validate="true" theme="xhtml">
<s:textfield label="%{getText('login.login')}" name="loginInput"/>
</s:form>

I have a validation on it :
<validators>
    <field name="loginInput">
        <field-validator type="requiredstring">
            <message key="errors.required"/>
        </field-validator>
    </field>
</validators>

And the "errors.required" is in my package.properties :
errors.required= The field "${getText(fieldName)}" is required !
login.login = Login

But this will displays : "The field "loginInput" is required !"

And I would like : "The field "Login" is required !". So I would like 
something which get the localization of my textfield label (login.login) 
to have localization in my error message, and not the field name, which 
does not say anything to the user :)

Could someone tells me how to do ?

Thanks a lot !

Regards,

Michaƫl.

Reply via email to