FAQ

[Struts-user] [S2] passing parameter to property in validation

Mailtolouis2020-Struts
Nov 30, 2009 at 11:08 am
Hi,

I've a property in my resource bundle like this
error.required = {0} is required.
label.name = Name
label.email = Email

In my validation xml file,

I've this rule

<field name="name">
<field-validator type="requiredstring">
<message key="error.required"/>
</field-validator>
</field>


I want to pass label.name to error.required, how to do that?

I've tried these:

<field-validator type="requiredstring">
<message key="error.required">
<param key="label.name"/>
</message>
</field-validator>

and
<field-validator type="requiredstring">
<message key="error.required">
<param>label.name</param>
</message>
</field-validator>

both still giving me the same result
{0} is required


Regards
LV
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Mailtolouis2020-Struts: 1 post