You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by adam kramer <ad...@monkey.org> on 2002/12/19 22:37:20 UTC

BeanUtil.copyProperties problem with casted ActionForm

I keep getting an error in my Action where I am using
BeanUtils.copyProperties to copy from a ActionForm to a bean like so:
GrantForm grantForm = (GrantForm) form;
BeanUtils.copyProperties(grant, grantForm);

and i get the exception:
java.lang.IllegalArgumentException: argument type mismatch
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1669)

The weird thing is I don't get the error when I try:
GrantForm grantForm = new GrantForm();
BeanUtils.copyProperties(grant, grantForm);

So it only occurs when I cast the passed in form parameter to the right
form type.

Has anyone else had similar problems? I can say that my form does have
ArrayLists that my bean does not have but they are completely different
attribute names.

-adam k.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>