One more thing, as I use String type in my action class for datetimepicker, I
tried to validate that field with regex validator, like this:
<field name="date">
<field-validator type="regex">
<param
name="expression">[0-3][0-9].[0-1][0-9].[1-2][0-9][0-9][0-9]</param>
<message>Date is wrong</message>
</field-validator>
</field>
But nothing happens if I enter wrong date, it just store date that is already
in the date field ?
--
Thx Milan
Milan Milanovic <[EMAIL PROTECTED]> wrote:
Hi,
when I try this I got an exception:
WARN com.opensymphony.xwork2.util.OgnlUtil:369 - Caught OgnlException while
setting property 'min' on type
'com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator'.
java.lang.NoSuchMethodException: setMin(java.lang.String)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:810)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
at
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
...
Then I tried in my action class to represent date for datetimepicker field as
String (because of format problem), but I got the same error ?
--
Thx, Milan
Gabriel Belingueres wrote:
did you tried ${dateStart}?
2008/5/20, [EMAIL PROTECTED] :
> Hi all, i'm Dome, from Italy, and i'm having my troubles with Date
> Validation on Struts 2 :|
>
> Using xml validation, and need to validate a
> date.
>
> Let's say i have 2 dates taken from html form. I need the second
> one (if it does exist: it is not mandatory, actually) to be after the
> first one.
>
> Used coding such as:
>
>
>
>
>
>
>
> expression">dateStart]]>
>
> ERROR MESSAGE
>
>
>
>
> or
>
>
>
>
$dateStart
(Used
> also dateStart or #dateStart)
> ERROR MSG
>
>
>
> But none worked...
>
> Any
> suggestion?
>
>
> Thanks a lot...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]