Announcement Announcement Module
No announcement yet.
Date object in a HTML form Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date object in a HTML form


    I started with Spring about 3 weeks ago and I'm very happy with it. There is one question I have regarding date objects. I'm clear on howto set a date in the application context file using a customEditor. but I don't understand how I can do that in a html form with 3 selectboxes one for day,month and year. I can easily fake it somehow, but I wanted to know how you guys are doing that.

    Thanks a lot,
    Stan Wiechers

  • #2
    I'd probably have the 3 setter/getters for the day, month, and year, and then optionally put another method in the command object to get the combined Date object if all of the date, month, year values were set.


    • #3
      good idea, that should totally do it. i thought there would be some other way to bypass that.

      thank you,


      • #4
        The problem with using a single Date as the backing object for 3 input fields is when one or more of the day, month, year fields are empty.

        If you haven't already, you'd probably also get some value out of reading up on Property Editors.