Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 286 invoked from network); 6 Jan 2003 19:08:43 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 6 Jan 2003 19:08:43 -0000 Received: (qmail 5963 invoked by uid 97); 6 Jan 2003 19:09:46 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 5947 invoked by uid 97); 6 Jan 2003 19:09:46 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 5935 invoked by uid 98); 6 Jan 2003 19:09:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Reply-To: From: "Paul Idusogie" To: "'Struts Users Mailing List'" , "'Rick Reumann'" Subject: RE: Please Help! Nested form property attributes. Date: Mon, 6 Jan 2003 13:02:49 -0600 Message-ID: <006701c2b5b6$49cecc40$0401010a@poidusogie> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) Importance: High In-Reply-To: <88330046992.20030106134151@reumann.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I modified the formbean and action class to accept a date string and it work Thanks Thanks Thanks..... Sincerely, Paul Idusogie Email: poidusogie@att.net Tel: 651.714.8779 -----Original Message----- From: Rick Reumann [mailto:maillist@reumann.net] Sent: Monday, January 06, 2003 12:42 PM To: Struts Users Mailing List; poidusogie@att.net Cc: Samir Shah Subject: Re: Please Help! Nested form property attributes. On Monday, January 6, 2003, 12:44:38 PM, Paul wrote: PI> rootCause PI> java.lang.IllegalArgumentException: argument type mismatch at PI> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at PI> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 PI> What do I do? enrollDate should be a String in your formBean. Are you sure you aren't trying setting enrollDate as a Date type in your form bean? I cc'd Samir as well, since I think he is having similar problems. I think it's nice and clean to deal with Dates in forms this way: 1) Have a form bean with all Strings representing your jsp form. So something like birthDate would be set up as a String. 2) Have a business bean with the correct data types. For example.. java.util.Date birthDate, double someNumber, etc. 3) When you submit your jsp page to your action you can take care of the conversion of the FormBean(all Strings) to the correct data types and populate your business bean (usually called a DTO or ValueObject). Similarly, when going the other direction you can take a business bean and convert the Date fields into Strings (with the format you like) and populate your FormBean and display that to the user. As far as doing the conversion I usually take care of that outside of the Action and use the BeanUtils.copyProperties(..) but you can also just create your own helper class to do the conversions for you if you like. -- Rick mailto:maillist@reumann.net -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: