I'm having problems using a DynaValidatorForm object and FormFile objects. The following seems to work fine when using Safari but crashes with the following error when using Mozilla and IE:


org.apache.commons.beanutils.ConversionException:
Cannot assign value of type 'java.lang.String' to property 'file' of type 'org.apache.struts.upload.FormFile'


Searching through the archives I have seen some contradicting answers:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg15312.html
http://www.mail-archive.com/[EMAIL PROTECTED]/ msg47398.html


... and this example:
http://download-west.oracle.com/otn_hosted_doc/jdeveloper/904preview/ creating_html_clients/jsp_pstrutsdatapgdynaformbean.html



Before I run down the path of using a subclass of ActionForm (like in the struts-upload example) I wanted to be sure that I'm not missing something obvious.


I have the following defined:

struts-config.xml

        <form-bean
                name="applicationForm"
                type="org.apache.struts.validator.DynaValidatorForm">

                <form-property
                        name="file"
                        type="org.apache.struts.upload.FormFile"/>
        </form>

test.jsp

<html:form method="post" action="/applicationHandler" enctype="multipart/formdata">
<html:file property="file" />
</html:form>


action class (though it's not getting this far using IE):
        FormFile fileAttachment = (FormFile)actionForm.get("file");
        ... save it to the file system


Thanks for your help, - John


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to