spring 使用@Valid校验数据出错DEBUG org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod - Failed to resolve argument 0 of type
问题原因:在 @Valid 的那个参数后面紧跟着一个 BindingResult 的参数(一定要紧跟着)
参考来源:https://segmentfault.com/q/1010000008384686
正确的参数签名
@PostMapping("publishPost.do")
public String publishPost(@Valid @ModelAttribute Post post,
BindingResult bindingResult,
Errors errors, Model model, Integer tid,String action, RedirectAttributes attributes) {
错误的签名
//发帖
@PostMapping("publishPost.do")
public String publishPost(@Valid @ModelAttribute Post post,Integer tid,
BindingResult bindingResult,
Errors errors, Model model, String action, RedirectAttributes attributes) {
spring 使用@Valid校验数据出错DEBUG org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod - Failed to resolve argument 0 of type的更多相关文章
- eclipse里面配置spring,提示java.lang.ClassNotFoundException:org.springframework.web.servlet.Dispatcher错误
在eclipse里面创建了一个Dynamic 项目,用到spring,一直提示java.lang.ClassNotFoundException: org.springframework.web.ser ...
- transaction 用tx事务 测试时 报错:Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]
Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc ...
- spring:org.springframework.web.servlet.DispatcherServlet noHandlerFound解决方法
1.搜了许久: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern& ...
- Spring 整合hibernante 错误java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
1.将所需的jar包全部拷贝到WEB-INF/lib下,再重新启动tomcat便能顺利通过了.参考http://blessht.iteye.com/blog/1104450 最佳答案 spring ...
- idea/ecipse中使用maven集成springmvc相关jar包时候,出错:java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
参考stackoverflow:https://stackoverflow.com/questions/11227395/java-lang-classnotfoundexception-org-sp ...
- spring的困惑--org.springframework.web.servlet.DispatcherServlet noHandlerFound
出现这种情况可能是代码没有更新到Tomcat服务器上
- 【spring 注解 错误】使用controller 作为后台给前台ajax交互数据出错
controller作为后台与前台的ajax进行交互,后台的方法处理完成返回一个boolean类型的值,想传给前台用来判断是否执行成功,BUT,问题来了: 严重: Servlet.service() ...
- Spring 4 官方文档学习(十一)Web MVC 框架
介绍Spring Web MVC 框架 Spring Web MVC的特性 其他MVC实现的可插拔性 DispatcherServlet 在WebApplicationContext中的特殊的bean ...
- Spring使用mutipartFile上传文件报错【Failed to instantiate [org.springframework.web.multipart.MultipartFile]】
报错场景: 使用SSM框架实现文件上传时报“Failed to instantiate [org.springframework.web.multipart.MultipartFile]”错,控制器源 ...
随机推荐
- FreeRTOS任务基础概念
RTOS系统的核心就是任务管理: 任务的特性 在RTOS中每个任务都有自己的运行环境,不依赖于系统中其他的任务或者调度器,任何一个时间点只能有一个任务运行,具体运行哪个任务是由任务调度器来决定的,而任 ...
- 动态规划1——最长递增子序列、最长公共子序列、最长公共子串(python实现)
目录 1. 最长递增序列 2. 最长公共子序列 3. 最长公共子串 1. 最长递增序列 给定一个序列,找出其中最长的,严格递增的子序列的长度(不要求连续). 解法一:动态规划 通过一个辅助数组记录每一 ...
- 堆排序Heap_Sort
堆排序就是借助二叉堆进行排序,不了解二叉堆的可以先看这里.本文以升序排序为例,首先将待排序数组放置在最小堆中,此时堆顶一定是数组中最小的元素,然后删除堆顶元素,此时调整后的最小堆顶会是第二小的元素,从 ...
- django已经安装但是还是提示ModuleNotFoundError: No module named 'django'
首先查看自己django版本与python版本是否一致: 如果一致.可能是django安装的位置与python导包的位置不一致. 我将之前的python2.6升级到python3.6,结果pip in ...
- FastDFS-基本介绍
1. 什么是FastDFS FastDFS是用c语言编写的一款开源的分布式文件系统.FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用Fas ...
- C# 截图不失真
Bitmap bmp = new Bitmap(@"E:\2222.jpg"); Bitmap bmp2 = bmp.Clone(new Rectangle(10 + 80, 15 ...
- 解压 .tar.xz 格式的压缩文件
第一种方法: xz -d mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz tar -xvf mysql-8.0.16-linux-glibc2.12-x86_64 ...
- IDEA创建类似于Eclipse的source folder
1.新建普通文件夹目录directory 2.当前Module右键Open Mudule Settings(F12) 3.选中新建的文件夹并单击上面的Sources,看到文件夹颜色变化即成功.
- P4213【模板】杜教筛(Sum)
思路:杜教筛 提交:\(2\)次 错因:\(\varphi(i)\)的前缀和用\(int\)存的 题解: 对于一类筛积性函数前缀和的问题,杜教筛可以以低于线性的时间复杂度来解决问题. 先要构造\(h= ...
- 015_STM32程序移植之_NRF24L01模块
STM32程序移植之NRF24L01模块 引脚接线图如下所示 STM32引脚 NRF24L01引脚 功能 GND GND 3.3V 3.3V PB8 CE PB9 CSN PB13 SCK PB15 ...