commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knight, Digby" <>
Subject Simple question re BeanUtils and dates
Date Mon, 07 Apr 2003 11:55:55 GMT

I'm afraid my firewall blocks searching the mail archives, so I'm having to
ask a question that's probably been asked before.

I'm trying to use BeanUtils to set a date property of a bean from an
HttpRequest (in yyyy-mm-dd format), but can't see how to do it with standard
functionality (BeanUtils.setProperty() or BeanUtils.populate()). I have
written and registered my own DateConverter which worked, but seems an
unlikely thing to have to do when there are all the standard converters

I've been trying all the code from the API overview, but I keep getting an
"argument type mismatch" if I don't register my own Converter.

Could anyone send me some code which will populate this bean from the
request below:

public Bean {
	private Date date;
	public Date getDate() { return date; }
	public setDate(Date date) { = date; }


If the code can recognize any format for the date, so much the better!

Thanks in advance.


The information in this email and in any attachments is 
confidential and intended solely for the attention and use 
of the named addressee(s). This information may be 
subject to legal professional or other privilege or may 
otherwise be protected by work product immunity or other 
legal rules.  It must not be disclosed to any person without 
our authority.

If you are not the intended recipient, or a person 
responsible for delivering it to the intended recipient, you 
are not authorised to and must not disclose, copy, 
distribute, or retain this message or any part of it.

View raw message