aspose file tools*
The moose likes Beginning Java and the fly likes Date problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date problem" Watch "Date problem" New topic
Author

Date problem

Meena sabapathy
Greenhorn

Joined: May 31, 2009
Posts: 2
Hello,


I created backin bean in java.sql.date type, for front end i used seperate bean which is of string datatype.but when i set the value to backing bean data type mismatch eror is coming

In backing bean i declared:

private java.sql.Date approvedDate;

In fron end bean i declared:

private String approvedDate;

so if i set crip.setApprovedDate(approvedDate); in fronend bean i getting datatype mismatch error.I dont know how to convert


Can anyone help me to solve this problem.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
The better would be to use the same form bean, and provide a utility method in the bean say getApprovedDateString(), which suppose to give you the String representation of that date. In that method you can use java.text.DateFormat class to format the date. You can also have a look at Jode Time API. Further, you might want a particular date format through out the application, in that case just define date format some where appropriate.
 
jQuery in Action, 2nd edition
 
subject: Date problem