Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date problem

 
Meena sabapathy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic