0

This is my validation field of date type and current is an hidden variable having get & setter in action class:

<param name="min">01/01/1920</param>
<param name="max">${new java.util.Date(current}</param>  
<message>Your Birth date must be less than ${min} and ${max} date!</message>

Please help the above code is working for min but the max value is blank..

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
JZombie
  • 1
  • 1

1 Answers1

0

Action:

private Date current;

public Date getCurrent(){
    return current;
}

Validator:

<field name="birthday">
    <field-validator type="date">
        <param name="minExpression">01/01/1920</param> 
        <param name="maxExpression">${current}</param> <!--calls getCurrent();-->
        <message>
            <![CDATA[ Your Birth date must be between ${min} and ${max}! ]]>
        </message>             
    </field-validator>
</field>

Also take a look at the documentation, it's all explained there.

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243