Spring type conversion von String nach DateTime

dmike

Bekanntes Mitglied
Ich will per Spring 3.0.5 eine Bean testen. Diese Bean hat eine Property vom Typ DateTime (also JodaTime).
Wie muss die xml Definition aussehen?

Wenn ich es so mache, beschwert sich Spring (wohl zu recht), dass es die Conversion nicht hinbekommt.

[XML]
<bean id="ExpiredAcccount" class="de.mm.moreevent.types.Account" scope="prototype">
<constructor-arg value="james"/>
<constructor-arg value="password"/>
<constructor-arg value="this is james's last's expired account"/>
<property name="accountExpireDate" value="2011-08-18 09:36:25"/>
</bean>

[/XML]
 
[XML]<bean id="ExpiredAcccount" class="de.mm.moreevent.types.Account" scope="prototype">
<constructor-arg value="james"/>
<constructor-arg value="password"/>
<constructor-arg value="this is james's last's expired account"/>
<property name="accountExpireDate">
<bean class="org.jodatime.DateTime">
<constructor-arg value="Zeit in Milisekunden zum Beispiel" />
</bean>
</property>
</bean>[/XML]
 
[XML]<bean id="ExpiredAcccount" class="de.mm.moreevent.types.Account" scope="prototype">
<constructor-arg value="james"/>
<constructor-arg value="password"/>
<constructor-arg value="this is james's last's expired account"/>
<property name="accountExpireDate">
<bean class="org.jodatime.DateTime">
<constructor-arg value="Zeit in Milisekunden zum Beispiel" />
</bean>
</property>
</bean>[/XML]


s/org.jodatime.DateTime/org.joda.time.DateTime/

dann gehts. Danke.
 

Neue Themen


Zurück
Oben