Someone on struts-user posted a DateBeanUtilsConverter class that I need
help using.  It implements Converter, and from the BeanUtils API it sounds
like I need to "register" this class somewhere so that
PropertyUtils.copyProperties will use it to convert the Date object in my
Value Object into a String for the ActionForm property.

Right now, this only if both the ActionForm [contactForm] and the Value
Object [contact] have matching property types.  And then it blows up if you
type in something other than YYYY-MM-DD in the text area.  I need a String
for the ActionForm (it's coming from an HTML form) and a Date (currently
java.sql.Date, but I'm flexible) for the Value Object.
  PropertyUtils.copyProperties( contactForm, contact );

I'm sure this has been done before, but I'm having trouble adapting the
examples I've found into a Struts app.
I've found the 'ConvertUtils' class now... does anyone have advice on where
to do the registering of the Converter?  I do have a ServletContextListener,
so I think that's good for now.  Please let me know if there's a better
place.

Thanks for any advice on this,

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

--
To unsubscribe, e-mail:   <mailto:commons-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-user-help@;jakarta.apache.org>

Reply via email to