struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregor Rayman" <gray...@gmx.net>
Subject Re: Dates and Struts
Date Wed, 22 Aug 2001 12:01:20 GMT
"Matt Raible" <matt_raible@yahoo.com> wrote:


> Is it true that Struts cannot handle a java.sql.Date or java.util.Date
> datatype?  I seem to get errors everytime I try to have one in my form.
>
> Thanks,
>
> Matt

No it cannot. Date is not so easy to parse since it is locale dependent.
Also the displaying a date is not easy.

This brings me to one general architecture question:

Where do you (I mean all struts users) put the formatting/parsingĀ“of
values?

For display only data, I try to put it into the JSP (with custom tags).

But what about the editable data? Is the ActionForm the right place?

I store the data in non-string form (like Date) and the get/set methods
operate with strings. The language dependent formats use an addiotional
property "locale" which I set either in the reset() method (from request
and session).

It could be done simpler, I used only string aware ActionForms and the
whole formatting were done in Action.perform, but this wouldn't be conform
with the MVC pattern, woul'd it?

--
gR


Mime
View raw message