错误“由于未提供多部分配置而无法处理部件”上传文件时 [英] Error "Unable to process parts as no multi-part configuration has been provided" when uploading file

查看:7457
本文介绍了错误“由于未提供多部分配置而无法处理部件”上传文件时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过JSP文件中的表单上传文件,但是出现这个错误。该servlet已经有了@MultipartConfig表示法。

I am trying to upload an file via a form in a JSP file, but I'm getting this error. The servlet already has the @MultipartConfig notation. I'm using servlet 3.0 and apache tomcat 8.

错误消息:

Error message:

java.lang.IllegalStateException: Unable to process parts as no multi-part configuration has been provided

on line

Collection<Part> parts = request.getParts();`


推荐答案

添加

I had to add

allowCasualMultipartParsing="true"

在context.xml中的上下文标签中

on context tag inside context.xml

这篇关于错误“由于未提供多部分配置而无法处理部件”上传文件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆