zoukankan      html  css  js  c++  java
  • spring mvc MultipartFile 上传文件错误解决

    org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface
        org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:101)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveModelAttribute(HandlerMethodInvoker.java:762)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:356)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
        org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
        org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

    搞了2个小时,最后还是去百度上看到有大神说这种错误在Controller的MultipartFile参数前面加上@RequestParam就能解决

  • 相关阅读:
    HTML
    数据库
    EF增删查改(三)------终极版
    三层的之间的引用
    sql:PostgreSQL
    csharp:SQLite and Access using C# code read data
    sql:Mysql create view,function,procedure
    sql: MySQL and Microsoft SQL Server Stored Procedures IN, OUT using csharp code
    Working C# code for MySql5.5 Stored Procedures IN parameters
    csharp:search and Compare string
  • 原文地址:https://www.cnblogs.com/-zpy/p/8904185.html
Copyright © 2011-2022 走看看