Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java struts中的文件上传_Java_Tomcat_Struts_Struts Config - Fatal编程技术网

Java struts中的文件上传

Java struts中的文件上传,java,tomcat,struts,struts-config,Java,Tomcat,Struts,Struts Config,我正在j2ee项目中使用Struts。我必须上传一个文件我的jsp的简单形式是这样的 <html:form action="/MerchantComplaintAdd" method="post" enctype="multipart/form-data"> <html:file property="file" size="50" /> <html:submit styleClass="FormButton" >Save</html:submit>

我正在j2ee项目中使用Struts。我必须上传一个文件我的jsp的简单形式是这样的

<html:form action="/MerchantComplaintAdd" method="post" enctype="multipart/form-data">
<html:file property="file" size="50" />
<html:submit styleClass="FormButton" >Save</html:submit>&nbsp;
</html:form>
你能告诉我struts配置文件中的配置有什么问题吗

线路

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

将是

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

线路

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

将是

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