On Fri, 7 Mar 2003 15:26:49 +0100 Søren Blidorf <[EMAIL PROTECTED]> wrote:
> Yes, it's a good point, but the only place my date is a String, is in > the ActionForm. > > Would you store the date as long there? With all due respect to apachep2 I would store myDate as a String in an ActionForm bean and then in your business class you store your Date as the Date you want (I prefer java.util.Date). So now the question becomes how do you quickly copy all of your String form bean properties into this business bean that has a type: java.util.Date.\ In your action you submit to you do: BeanUtils.copyProperties( yourBusinessBean, yourActionFormBean ) BUT, as you have realized copyProperties will not work for java.util.Date. So you need to register a converter. I posted about this a while a back and a search of the archives reveals the link below. I would change one thing though... following Craig's suggestion it's cleaner to register the converter as a Plugin which you can do easily in your struts-config file. Since all my DispatchAction classes extend a BaseAction I registered the converter there in a static block, which works, but it's just cleaner as a Plugin since you could easily swap out the converter at a later time. Let me know if this link helps. If you are still having trouble let me know. http://marc.theaimsgroup.com/?l=struts-user&m=103487187525032&w=2 -- Rick Reumann --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]