I would just like to ask how is a Date (in string) from a form is converted into java.util.Date object in struts2 by default.
I have noticed this strange behavaior, I have I timestamp/lastUpdated field displayed in the form (debugging purposes only),
when on submit the form failed the validation, the page will stay on the current page (with the form) with the unsaved data.
Now the problem is, the timestamp/lastmodified field value has been changed. Supposedly the field contains both the date and the time,
but now it only contains the date and the time was set to zero (the time part is dropped).
Now whenever I submit a valid form, my application will generate an error again:
This is because I implemented versioning/timestamping with my hibernate. The theory I have in mind is that when the object in my action class recieves
the value of the form, the timestamp/lastUpdate field was changed such that the time part of it was dropped, and when hibernate try to check the timestamp,
it failed because it is not anymore equal. And sure enough, when I tried to retrieve the timestamp / lastupdate field of the object to be saved before I invoke save
here are the values:
How do I prevent struts from dropping the time part of my timestamp field.
Is this really the default handling of struts with Date conversion (dropping time part), or have I done it incorrectly?
ps: I plan to create a custom converter for my timestamp/lastmodified field, by it is not working, I dont know what's the problem.