在用cos包进行文件上传的时候,出现错误java.io.IOException: Corrupt form data: premature ending,网上找了很多资料,原因是说: com.orielly.servlet.MultipartRequest与org.apache.struts2.dispatcher.ActionContextCleanUp一起存在;要删除web.xml文件中的
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
这段代码。问题是我的web.xml文件中也没有写这段代码。
还有解决办法就是说把web.xml文件中的/*改为*.action。
这个方法试过了都没用,请知道解决办法的大神来指点一下?