文件上传报错java.io.IOException: Corrupt form data: premature ending

蕸钕 2013-11-19 10:21:41
在用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。
这个方法试过了都没用,请知道解决办法的大神来指点一下?

...全文
562 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Defonds 2013-12-04
  • 打赏
  • 举报
回复
这个貌似 cos 的 bug,还没修复?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧