`
chenhua_1984
  • 浏览: 1250291 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

Expected MultipartHttpServletRequest: is a MultipartResolver configured?

阅读更多
写道
java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a MultipartResolver configured?
org.springframework.util.Assert.notNull(Assert.java:112)
org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.resolveName(RequestParamMethodArgumentResolver.java:171)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:89)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79)
org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

  

spring mvc中上传附件,需要做两步操作

  1. 引入包commons-fileupload-1.3.jar,版本号可以根据项目情况调整;
  2. 在spring mvc配置文件中增加配置,文件大小限制可根据项目情况调整:
     
    <!-- 上传文件拦截,设置最大上传文件大小   10M=10*1024*1024(B)=10485760 bytes -->  
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">  
        <property name="maxUploadSize" value="10485760" />  
    </bean>
    
     
分享到:
评论

相关推荐

    hbase 启动regionserver日志报错: Wrong FS: hdfs:// .regioninfo, expected: file:///

    NULL 博文链接:https://bnmnba.iteye.com/blog/2322332

    英语面试参考英语面试参考

    **A**: My expected salary is 12,000 yuan per month. 8. **Q**: What are your income expectations? **A**: I expect an annual income of at least 144,000 yuan. 9. **Q**: What are your pay expectations?...

    HTK3.4的.MKF 文件.zip

    window编译HTK3.4时会报错:htk_htklib_nt.mkf(6):fatalerrorU1035:syntaxerror:expected‘:’or‘=’separatorStop.这主要是由于这个文件格式编码的问题,只需下载然后替换相应的mkf文件,重新编译即可。目前发现HTK...

    keil常见错误.pdf

    main.c(35): warning: #128-D: loop is not reachable from preceding code main.c(54): warning: #1-D: last line of file ends without a newline initSpi.c(6): error: #268: declaration may not appear after ...

    解决opencv3.2 OpenCVUtils.cmake:1047错误

    解决 48、80\120等错误 /cmake/.download/151805e03568c9f490a5... expected hash: [151805e03568c9f490a5e3a872777b75] actual hash: [d41d8cd98f00b204e9800998ecf8427e] status: [7;"Couldn't connect to server"]

    Centos6.4安装Oracle11G

    ### Centos6.4安装Oracle11G:详细步骤与注意事项 #### 环境配置与准备工作 在开始安装Oracle11G之前,确保已经具备一个稳定的CentOS 6.4环境。根据提供的描述,本案例是在虚拟机redhat6.4Desktop上进行的,默认...

    出国英语实用口语会话实例.docx

    - "Is there a bathroom nearby?" - "Do you know where the WC is?" ### Unit 4: I Don't Feel Well (Particle Conversation) - **情景**: 感觉不适时向他人表达。 - **常用表达**: - "I’m not feeling well....

    delphi问题常见解决

    1. **“statement expected but procedure found”**:这个错误提示表明在编译器尝试找到一个语句的地方,它却找到了一个过程(Procedure)的定义。这通常意味着你在某个过程或函数的定义中忘记了关闭的`end`关键字...

    shell脚本报错:"[: =: unary operator expected"解决办法

    在使用Shell脚本编程时,有时我们可能会遇到一个常见的错误提示:“[: =: unary operator expected”。这个错误通常出现在我们尝试进行条件判断时,尤其是当我们在`if`语句中使用`[ ... ]`或者`[[ ... ]]`进行比较...

    新概念英语第二册Lesson50PPT课件.pptx

    * than I expected:比我所预料的 * The question is easier than I expected.:这个问题比我预料的要简单。 * You are more beautiful than I expected.:你比我预料的要漂亮。 * You are better than I expected....

    Microsoft Excel File Format

    微软Excel文件格式是电子表格软件Microsoft Excel使用的数据存储格式,其版本涵盖了从Excel 2.0到Excel 2003的多个版本。这一文件格式详细描述了Excel文档的基本结构,包括工作簿(Workbook)和工作表(Worksheet)...

    jar包下载rocksdbjni-4.9.0.jar

    rocksdbjni-4.9.0.jar

    expected:C ++ 111417标准

    std::expected单个标头实现,带有功能样式的扩展名。 lang + GCC: MSVC: 在和上可用。 建议使用作为表示对象的首选方法,该对象将具有预期值或意外值,以提供有关某些原因的信息。 不幸的是,将许多可能失败的...

    au3反编译源码

    often this signature was modified or is used for a fake script that is just attached to distract & mislead a decompiler. When off it scans for the 'FILE' as encrypted text to find the start of a ...

    Arduino.Wearable.Projects.1785283308

    No previous experience in wearables is expected, although a basic knowledge of Arduino programming will help. What You Will Learn Develop a basic understanding of wearable computing Learn about ...

    英语答案 翻译改错.doc

    3. 错误:Is this museum that you paid a visit to a few days ago? 改正:Is this the one (museum) that you paid a visit to a few days ago? 或:Is this museum the one that you paid a visit to a few days ...

    Subversion 使用

    Subversion 使用指南 Subversion 是一个版本控制系统,旨在取代 CVS,具有许多优于 CVS 的特性。本文将详细介绍 Subversion 的使用、特点和优点。 目录操作 Subversion 允许文件、目录、拷贝、重命名操作加入版本...

Global site tag (gtag.js) - Google Analytics