You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Durham David R Jr Ctr 805 CSPTS/SCE <Da...@scott.af.mil> on 2005/05/05 18:15:41 UTC

multiple file uploads with one property

Tried using a property like this:

<form-bean name="..."
type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="files"
type="org.apache.struts.upload.FormFile[]"/>
</form-bean>

But I get the following class cast exception:

org.apache.commons.beanutils.ConversionException: Cannot assign value of
type
rg.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile'
to property 'files' of type '[org.apache.struts.upload.FormFile;'
	
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:424)
	
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(Propert
yUtilsBean.java:1733)
	
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(Propert
yUtilsBean.java:1648)
	
org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtils
Bean.java:1677)
	
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.jav
a:1022)
	
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:8
11)
	
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
	
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
	
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
or.java:798)

...

Any ideas what is happening?  It works if I take out the '[]'.


Thanks,

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org