aspose file tools*
The moose likes Struts and the fly likes Upload file using DynaActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Upload file using DynaActionForm" Watch "Upload file using DynaActionForm" New topic

Upload file using DynaActionForm

Rabee' Nawash

Joined: Feb 27, 2005
Posts: 14
Dear All,

Im trying to upload a file using dynamic action forms in struts , whenever I'm trying to upload the file the following exception is thrown :

SRVE0026E: [Servlet Error]-[BeanUtils.populate]: org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'lbFile' of type 'org.apache.struts.upload.FormFile'

to define the dynaActionForm in the struts config I use the following string:

<form-bean name="listLBPaymentsForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="bills" type="[]" />
<form-property name="dynaApplication" type="" />
<form-property name="lbFile" type="org.apache.struts.upload.FormFile"/>

in the jsp page:
<html:file property="lbFile" title="Upload Authorization" />

So anyone have any idea why struts excpect string rather than FileForm
Rabee' Nawash

Best Regards,<br />Rabee' Nawash
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Did you specify enctype="multipart/form-data" in your html:form tag? If not, this is what's causing your problem.

Consultant, Sima Solutions
Rabee' Nawash

Joined: Feb 27, 2005
Posts: 14
Ok thanks , it solves my problem , it seems that I write it multipart/formdata rather than multipart/form-data.

Again Thank You
[ January 09, 2006: Message edited by: Rabee' Nawash ]
I agree. Here's the link:
subject: Upload file using DynaActionForm
Similar Threads
Jason Hunter's MultipartWrapper and Struts?
File upload with websphere 6. file object is stripped.
File upload
DynaActionForm form property type of file input in struts-config.xml
how to upload multiple files using Struts