You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mr Alireza Fattahi <af...@yahoo.com> on 2002/11/02 06:21:12 UTC

Dynamic form and Upload

Hi,
I want to use struts dynamic form feature. 
There is form which has an upload file filed and some
input text. I used below in struts_config.xml


 <form-bean
  name="TenderVwcredForm"
  dynamic="true"
 
type="org.apache.struts.validator.DynaValidatorForm">
  <form-property name="tenderTitle" 
type="java.lang.String"/>
  <form-property name="productName" 
type="java.lang.String"/>
  <form-property name="tenderFile"  
type="org.apache.struts.upload.FormFile"/>
  </form-bean>



But I got the classcast exception:

error BeanUtils.populate
org.apache.commons.beanutils.ConversionException:
Cannot assign value of type 'java.lang.String' to 
property 'tenderFile' of type
'org.apache.struts.upload.F
ormFile'


Please help.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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


Re: Dynamic form and Upload

Posted by Mr Alireza Fattahi <af...@yahoo.com>.
Thanks for your reply,
I have seen the example and an work with it, But my
problem is I can not do that in an dynamic form. How
should I do it in dynamic form, and what should I put
in struts.config.xml?
As I told I got the class cast expetion.

Thanks

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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


Re: Dynamic form and Upload

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sat, 2 Nov 2002, Mr Alireza Fattahi wrote:

> Date: Sat, 2 Nov 2002 05:21:12 +0000 (GMT)
> From: Mr Alireza Fattahi <af...@yahoo.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Dynamic form and Upload
>
> Hi,
> I want to use struts dynamic form feature.
> There is form which has an upload file filed and some
> input text.

Using form beans (either standard ActionForm subclasses or using
DynaActionForm/DynaValidatorActionForm) is not sufficient for supporting
file upload functionality.  You must explisitly use the file upload
support provided by Struts directly (in 1.0) or indirectly via the
commons-fileupload module( in 1.1).

For an example of the required programming techiques, see the
struts-upload example app that is included with the Struts distribution.

Craig


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