struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Wang" <>
Subject what will happen if I have Data Types other than java.lang.String in my formbean - say
Date Fri, 08 Feb 2002 23:02:16 GMT
I have a formbean which include a field its type is java.util.Date, and I
have two methods to get and set
like these :
		Date getMyField() { return dateVar; }
		void setMyField(Date date ){ dateVar = date ;}

Now I use <html:text> to display this field, it displays the Date with the
'yyyy-mm-dd' format, I am wondering can I change the format?

Another big issue is I can not submit my form, when I submit my form
exception happens:

java.lang.IllegalArgumentException: argument type mismatch 	at
java.lang.reflect.Method.invoke(Native Method) 	at
8) 	at
4) 	at
org.apache.struts.util.PropertyUtils.setProperty( 	at
org.apache.struts.util.BeanUtils.populate( 	at
org.apache.struts.util.RequestUtils.populate( 	at
61) 	at
org.apache.struts.action.ActionServlet.process( 	at
org.apache.struts.action.ActionServlet.doPost( 	at
javax.servlet.http.HttpServlet.service( 	at
javax.servlet.http.HttpServlet.service( 	at
org.apache.tomcat.core.ServletWrapper.doService( 	at
org.apache.tomcat.core.Handler.service( 	at
org.apache.tomcat.core.ServletWrapper.service( 	at
2) 	at

I know if I change the getter and setter method to String everything is OK,
but can struts supports java.util.Date in formbean?

thanks in advance

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message