Tags and Calendars
Posted on 2005-05-03
I'm fairly new to Struts, JSP and tag libraries and am wondering if there is a way around this problem.
I have the code:
<bean:write name="version" property="created" format="h:mm a, EEEE, MMMM d, yyyy"/>
As long as getCreated() on the version object returns a Date object this works fine.
If however getCreated() returns a Calendar object it breaks. Not really surprising I guess since it expects a Date.
Is there an easy way to modify the bean:write tag above so that it converts the Calendar into a Date (i.e. call the getTime on the calendar object) and will therefore work?