You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Erickson <de...@cmcflex.com> on 2004/04/02 22:22:16 UTC

Validation-Substituting Values Question

Hi I am using some ValidatorActionForms.. here's an example of my validation
mapping:

<form name="/admin/updateUser">

<field property="user.email" depends="required,email">

<msg name="email" key="error.email.format"/>

<arg0 key="(How do I insert the value of that variable here?!)"
resource="false"/>

</field>

</form>



my message looks like error.email.format={0} is not a valid e-mail address.

What I'm wondernig is how do I substitute the actual value they inputted
into the message using the validate.xml?  I know I can do it easily if I
hand validate it in the forms validate method.. but I'm sure there has to be
a way to do it like this!  Any help greatly appreciated.

-David


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validation-Substituting Values Question

Posted by Johannes Wolfgang Woger <jw...@chello.at>.

David Erickson wrote:

>Hi I am using some ValidatorActionForms.. here's an example of my validation
>mapping:
>
><form name="/admin/updateUser">
>
><field property="user.email" depends="required,email">
>
><msg name="email" key="error.email.format"/>
>
><arg0 key="(How do I insert the value of that variable here?!)"
>resource="false"/>
>
></field>
>
></form>
>
>  
>
say  <arg0   key="name.of.my.email"/>

than in your Applicaltinresources.properies:

name.of.my.email=" this email"
error.email.format="has a wrong format"

>
>my message looks like error.email.format={0} is not a valid e-mail address.
>
>What I'm wondernig is how do I substitute the actual value they inputted
>into the message using the validate.xml?  I know I can do it easily if I
>hand validate it in the forms validate method.. but I'm sure there has to be
>a way to do it like this!  Any help greatly appreciated.
>
>-David
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org