• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Date problem

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Yes, my master! Here is the tiny ad you asked for:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic