You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vincent Berruchon <vi...@neo-logism.fr> on 2002/10/01 18:12:07 UTC

Date in ActinoFormBean?

  Hello Struts Users,

I've used a property of type Date (java.util.Date), it seems to work to 
but put the date in an input but how to validate this date if the user 
change it?
Does it works?
for the moment I get that exception (javax.servlet.ServletException: 
BeanUtils.populate:
...
----- Root Cause -----
java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at 
org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:988)
	at 
org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:904)
----

Perhaps this type mismatch comes from my Date properties??

Does Struts try to parse the string to get a Date instance, and when it 
fails?

Should I use a property of type String, and make my own validation with 
something like DateFormat.parse()...

Thanks
Vincent



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>