• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Upload file using DynaActionForm

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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="com.sts.sme.lb.LBPayment[]" />
<form-property name="dynaApplication" type="com.sts.sme.lb.LBApplicationRequest" />
<form-property name="lbFile" type="org.apache.struts.upload.FormFile"/>
</form-bean>

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

So anyone have any idea why struts excpect string rather than FileForm
Regards
Rabee' Nawash
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you specify enctype="multipart/form-data" in your html:form tag? If not, this is what's causing your problem.
 
Rabee' Nawash
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic