`
chenhua_1984
  • 浏览: 1234444 次
  • 性别: 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

    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 ...

    Centos6.4安装Oracle11G

    Centos6.4安装Oracle11G,图形化界面安装

    delphi问题常见解决

    在编译时遇到“statement expected but procedure found”:在当前报错的procedure前,缺少了一个end结束标签。

    hisi_pwm_leds_20200417.rar

    海思平台hi3559A 上, 通过PWM控制LED亮度的驱动源码。源码主要包括hi3559A的pwm控制部分, LED的控制和设置部分。同时还提供了一套测试的接口。

    Go Modules.docx

    Is it possible to remove a module from a multi-module repository? Can a module depend on an internal/ in another? Can an additional go.mod exclude unnecessary content? Do modules have the equivalent ...

    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 ...

    HV_based_expected_improvement_matlab_multi-objective_HVEI_优化模型_多

    多目标优化,模型优化,超体积期望提升算法

    sysstat-10.1.5-4.el7.x86_64.rpm

    Sysstat 是一个软件包,包含监测系统性能及效率的一组工具,这些工具对于我们收集系统性能数据

    Microsoft Excel File Format

    OpenOffice的文档Microsoft Excel File Format.描述了微软Excel .xls文档的基本格式,包括基本的流(stream)和常见的记录(record)。

    linux下安装jsoncpp

    linux安装jsoncpp,可以直接复制到相应目录,在复制该文件之前要将前一篇资源也复制进去即可。具体的安装过程见技术博客

    Xcode文件 lib(c++1,sqlite3,z1)

    libsqlite3.dylib、libz.1.dylib、libc++.1.dylib

    Subversion 使用

    一个介绍Subversion 使用的网络集结使用说明使用手册

    Python.Scripting.for.ArcGIS.pdf

    Python Scripting for ArcGIS is a guide for experienced users of ArcGIS Desktop to get started with Python scripting without needing previous programming experience. Experience with other scripting or ...

    expected time bounds for selection

    expected time bounds for selection

    The Art of Computer Networking

    read up and learn other things before you can tackle the problems directly: this is all part of the exercise. The best way of learning this kind of material is by direct experience. And quite often ...

Global site tag (gtag.js) - Google Analytics