struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MK Tan" <mktan...@gmail.com>
Subject Re: RE [S2] How to have validation message using localization ?
Date Thu, 19 Apr 2007 11:04:20 GMT
do u have a property named loginInput in package.properties?
IIRC, if struts / webwork can't find the appropriate property, it will
display the key as output

HTH

Best regards,
MK Tan



On 4/19/07, MLENEVEUT@abusinessware.com <MLENEVEUT@abusinessware.com> wrote:
>
> Anyone ? :(
>
>
> Michaël
>
>
>
>
> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message