my dog learned polymorphism*
The moose likes Spring and the fly likes Date gets updated with null value in DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Date gets updated with null value in DB" Watch "Date gets updated with null value in DB" New topic
Author

Date gets updated with null value in DB

Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205

I am trying to update the user form which conatins some date.

Blow line is in JSP page/form:

// this value contatins the proper date with timestamp.


In the User.java which is entity

I have following attribute:




I am using spring MVC,
whenever I try to update the form, particular date column it gets updated with null value.
Can you guess what is the problem it is having?


Thanks in advance.
Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
I beleive you'll need to register a property editor to handle this conversion. In particular, you'll need to register the CustomDateEditor. Theck out the example in the reference doc for one way to do this.
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-webdatabinder
Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205
Thanks Mark..it's working
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Date gets updated with null value in DB
 
Similar Threads
hibernate update
editing values in the jsp and updating the table
Coding binding attibute for my custom Component
passing many values from jsp and getting only one value in servlet?
can anyone tell me how do we update the values in servlet?