struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muralidhar Yaragalla <java.yaraga...@gmail.com>
Subject Re: How to validate multiple fields with the same name
Date Mon, 25 Mar 2013 20:47:50 GMT
Hi thanks for this. It is really helpful.


On Tue, Mar 26, 2013 at 12:13 AM, Lukasz Lenart <lukaszlenart@apache.org>wrote:

> 2013/3/25 Muralidhar Yaragalla <java.yaragalla@gmail.com>:
> > Hi Thanks for this.But i am aware of this info I mean the normal
> validation
> > methods. I repeat and the important point is that all the 4 fields i have
> > contains the same name so how do i do that in an xml. I know that it can
> be
> > done inside valiadtion() method. I thought so much but it looks
> impossible
> > for me to do in validation.xml file using validators.
>
> But in action is just one field? eg. private List<String> values? So
> the field name is values and you can use expression validator to have
> at least to fields filled:
>
>         <field name="values">
>                 <field-validator type="fieldexpression">
>                         <param name="expression">(values.size > 1)</param>
>                         <message><![CDATA[ at least two values are
> required ]]></message>
>                 </field-validator>
>         </field>
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

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