Struts 1 ActionForms - What's the convention for dates in the form?

Viewed 7200

I am about to start with e project that uses Struts 1.2. There is no plan to move to another framework.

I wanted to know what's the convention when handling a date in the form?

  1. Should I create a Date variable and create a setDate(String date) method where the conversion will occur?

  2. Create a Date variable, a setDate(Date date) and register a special converter somewhere in the chain? (don't know if it's possible)

  3. Create a String variable, a setDate(String date) and let the conversion/validation to the validate method in the ActionForm bean?

Or another approach?

Also, if you have any advice to get up to speed with this framework, I would really appreciate it.

1 Answers
Related