q5738415 2017-05-04 10:57 采纳率: 0%
浏览 1159

问一个关于springmvc的问题

我在前台用form提交数据,上传文件,后端用\@RequestParam(value="file") MultipartFile file这种方式来接受上传的文件

然后在方法里就把接受到的文件存储到了本地文件夹中,这些都完成了,看了另存的目录中,也的确有上传的文件

但很疑惑的是在整个控制层方法执行完毕后,会有三行异常信息出现:
o.s.w.s.m.a.AnnotationMethodHandlerExceptionResolver-Resolving exception from handler [web.DemoServlet@799808f9]:org.springframework.web.bind.MissingServletRequestParameterException: Required MultipartFile parameter 'file' is not present

o.s.w.s.m.a.ResponseStatusExceptionResolver-Resolving exception from handler [web.DemoServlet@799808f9]:org.springframework.web.bind.MissingServletRequestParameterException: Required MultipartFile parameter 'file' is not present

o.s.w.s.m.s.DefaultHandlerExceptionResolver-Resolving exception from handler [web.DemoServlet@799808f9]:org.springframework.web.bind.MissingServletRequestParameterException: Required MultipartFile parameter 'file' is not present

这个问题困扰我两天了,关键是这是控制层方法完毕后才出现的东西啊,为什么啊?难道是视图解析有问题?
我的前台也的确是没有跳转,我是直接返回了一个json数据,已经标注了@ResponseBody了...
有没有遇到过类似情况的,救命啊\手动哭脸

  • 写回答

2条回答 默认 最新

  • weixin_38648313 2017-05-04 11:12
    关注

    喔喔喔喔喔,我是谁在我身边了

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?