You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Telmo Costa <te...@ef.pt> on 2007/04/14 18:46:17 UTC

[S2] Date validator error!

Hi everyone,

 

I have the following configuration for a java.util.Date field:

 

    <field-validator type="date" short-circuit="true">

        <param name="min">01/01/1990</param>

        <param name="max">01/01/2000</param>

        <message key="validator.date" />

    </field-validator>

 

But, when running it I got the following exception:

 

14/Abr/2007 17:42:50 com.opensymphony.xwork2.util.OgnlUtil
internalSetProperty

WARNING: Caught OgnlException while setting property 'max' on type
'com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator'.

java.lang.NoSuchMethodException: setMax(java.lang.String)

                at
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:810)

                at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)

 

The DateRangeFieldValidator has setters for "min" and "max" with
"java.util.Date" but ognl is trying to set a string.

 

I'm I doing anything wrong?

 

Tks a lot