struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kastner <kast...@galt.de>
Subject date validation
Date Mon, 26 Apr 2004 14:19:14 GMT
Hello,

maybe someone can help me. I am trying to use DynaValidatorForm to enter 
(amongst other fields) a date field.

So, my form bean definition contains this property setting:

<form-property name="paymentDue" type="java.util.Date" />

In my validation defintion, I use

<field
     property="paymentDue"
     depends="required,date">
     <msg
         name="required"
         key="invoiceeditform.error.paymentdue.required"/>
     <var>
         <var-name>datePattern</var-name>
         <var-value>dd.MM.yyyy</var-value>
     </var>
</field>

However, when I send the form, this exception is being thrown:

org.apache.commons.beanutils.ConversionException: Cannot assign value of 
type 'java.lang.String' to property 'paymentDue' of type java.util.Date'
...
...


Can anyone give me a hint, if there's anything wrong with my settings? 
I've checked with similar questions in this list and some 
documentations. If I am not totally off track the validator should be 
able to read date strings and convert them to java.util.Date objects.

Any help is very much appreciated.


Michael Kastner


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message