struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu MARC <>
Subject Multiple fields validation
Date Wed, 28 May 2008 05:31:44 GMT

I have a question about field validation.

I made a form  using struts2 tags in which I use an iterator to make 
select control :

<s:iterator value="week.semaine">
        <s:label labelposition="top" label="%{displayName}" />
        <s:select name="week.semaine[%{index}].am" 
onchange="countHour();" id="am%{index}" label="matin" list="heures" 
value="%{am}" />
        <s:select name="week.semaine[%{index}].pm" 
onchange="countHour();" id="pm%{index}" label="apr├Ęs-midi" list="heures" 
value="%{pm}" />

The list "heures" is a treeMap like 0 -> 00:00, 15 -> 00:15, 30 -> 00:30 ...

All is ok. Now, I want to validate the fields to secure the application. 
And I do not want to make 14 validators which are identical.

Is it possible to use regex for a 'name' in 'field', like :

    <field name="week.semaine*.[a|p]m"> 

Thanks for help.


Matthieu MARC

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

View raw message