How can I have a data field of type "Date" in my struts form (corresponding to an entry in a jsp page)? The form class generally has getters and setters for String and Boolean, not "Date".
Created May 8, 2012
WarnerJan Veldhuis Create a field as Date and in the setter convert the String parameter to a Date. To quickly convert the date, use:
In the getter, format the date into whatever String you want on your screen:
theDate = DateFormat.getDateInstance().parse(myDateParameter);
In the getter, format the date into whatever String you want on your screen:
return DateFormat.getDateInstance().format(theDate);