This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Date conversion problem in form bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Date conversion problem in form bean" Watch "Date conversion problem in form bean" New topic
Author

Date conversion problem in form bean

Ashimashi Kabashi
Ranch Hand

Joined: Sep 11, 2006
Posts: 84
Hello!

I am facing a little issue when trying to save a date.
The input is coming from a standard <html:text..> field but the getter setter methods in the form bean expect a data type Date.

Now when I run the application it gives me an IllegalArgumentException because it is expecting a java.util.Date and getting a string.

I need to save it to a type java.util.Date because the field in the database is of type Date.

question is// do I typecast the String to date? how and at what point?

Help needed guys!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date conversion problem in form bean
 
Similar Threads
what's the difference?
argument type mismatch problem using java.util.Date
a bit comfused about java.util.Date and java.sql.Date
Error: beans.property.conversion
struts2 date conversion question