struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <>
Subject Re: How to validate multiple fields with the same name
Date Mon, 25 Mar 2013 18:43:26 GMT
2013/3/25 Muralidhar Yaragalla <>:
> 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>

+ 48 606 323 122

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message