Yes the good properties would be login.login.required= The field "${getText(login.login)}" is required !
But I would like to do it automatically with a generic error message : errors.required= The field "${getText(???)}" is required ! and the ??? is replaced with the "label" of the input, to get the localized message printed at the user, not the fieldName... Can't we do that ? Regards, Michaël Just to make sure, did you tried %{getText('login.login')} ? because fieldName you give you the fieldName, that is loginInput. Best, Felipe MLENEVEUT 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. > > -- View this message in context: http://www.nabble.com/-S2--How-to-have-validation-message-using-localization---tf3599220.html#a10063744 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]