Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 59495 invoked by uid 500); 22 Aug 2001 12:04:57 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: struts-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 59474 invoked from network); 22 Aug 2001 12:04:57 -0000 Received: from mail.gmx.net (213.165.64.20) by h31.sny.collab.net with SMTP; 22 Aug 2001 12:04:57 -0000 Received: (qmail 12023 invoked by uid 0); 22 Aug 2001 12:04:30 -0000 Received: from pd9509d59.dip.t-dialin.net (HELO SUNRISE) (217.80.157.89) by mail.gmx.net (mp006-rz3) with SMTP; 22 Aug 2001 12:04:30 -0000 Message-ID: <02ed01c12b02$28e80db0$4c01a8c0@int.itechnology.de> From: "Gregor Rayman" To: , References: <20010822113858.98709.qmail@web14303.mail.yahoo.com> Subject: Re: Dates and Struts Date: Wed, 22 Aug 2001 14:01:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N "Matt Raible" 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