关于ssm文件上传报错The current request is not a multipart request

1:The current request is not a multipart request

1:from中涉及到图片上传的就要用post提交方式。否则就会报这个错误。一定要注意,这个我自己踩过坑,要把form请求方式改为post

2:第一中:在jsp页面的<head></head>标签里面加上<meta http-equiv="Content-Type" content="multipart/form-data;         charset=utf-8" />,用ajax提交的时候如果没有在页面设置<meta http-equiv="Content-Type"                              content="multipart/form-data; charset=utf-8" />这个也会报这个错误。

    原因请看http://www.tuicool.com/articles/FrY7Fv:

  3:第二种:在from表单的属性设置里面加上enctype="multipart/form-data"

  原因请看http://zkliqiang.iteye.com/blog/779285

2:Expected MultipartHttpServletRequest: is a MultipartResolver configured?

出现这个原因是需要在spring-mvc.xml 加上一句话

multipartResolver 这个很重要

3:Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject

猜你喜欢

转载自blog.csdn.net/good_luck_l/article/details/88557920