Validation failed for object='employee'. Error count: 1问题解决
2018-11-13
在表单提交时有时候会提示 Validation failed for object=’user’. Error count: 1,其中user是表的名字,Error count是对应数据库中出错的第几个字段,解决方法有两种:
第一种
把表单中需要提交的数据按数据库中字段的顺序提交
第二种
在表单对应的controller中添加BindingResult
第二种:
//员工添加
@PostMapping("/emp")
public String addEmp(Employee employee, BindingResult bindingResult){
//redirect重定向到一个地址
//forward表示转发到一个地址/代表当前项目下路径下的emps
System.out.print(employee);
// employeeDao.save(employee);
return "redirect:/emps";
}
Validation failed for object='employee'. Error count: 1问题解决的更多相关文章
- 【报错】Validation failed for object='userLogin'. Error count: 1
提交表单之后: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing ...
- gitment Error:validation failed错误解决办法
点击Initialize comments 突然跳转出一个错误Error:validation failed 经查阅之后发现 issue的标签label有长度限制!labels的最大长度限制是50个字 ...
- Object type TYPE failed to create with error
ORA-39083: Object type TYPE failed to create with error: ORA-02304: invalid object identifier litera ...
- URL validation failed. The error could have been caused through the use of the browser's navigation
URL validation failed. The error could have been caused through the use of the browser's navigation ...
- ORA-19563: header validation failed for file
在测试服务器还原数据库时遇到了ORA-19563错误.如下所示 RMAN-00571: ======================================================== ...
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法 You can extract all the ...
- Validation failed for query for method
问题原因 sql语法,使用@Query("select id, username, usersex, userphone from User where User.usersex = ?1& ...
- Oracle sqlldr导入之“MAXIMUM ERROR COUNT EXCEEDED”
昨天看到一个同事在通过PL/SQL Developer工具把文本数据往oracle表;有两个文本:一个有30万条记录:一个7万多条记录.在导入到过程中:出现错误记录还需要点击确认.不过使用黑科技(屏幕 ...
- Validation failed for query for method public abstract boxfish.bean.Student boxfish.service.StudentServiceBean.find(java.lang.String)!
转自:https://blog.csdn.net/lzx925060109/article/details/40323741 1. Exception in thread "main&quo ...
随机推荐
- adb ( Android Debug Bridge)
adb ( Android Debug Bridge) 是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信.它可为各种设备操作提供便利,如安装和调试应用. adb工具的工 ...
- 关于STM32 __IO 的变量定义
这个_IO 是指静态 这个 _IO 是指静态 volatile uint32_t 是指32位的无符号整形变量uint32_t 是指32位的无符号整形变量: 搞stm32这么久了,经常看到stm32里面 ...
- swift 实践- 06 -- UITextView
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoa ...
- 【转载】 Eclipse注释模板设置详解
Eclipse注释模板设置详解 网站推荐: 金丝燕网(主要内容是 Java 相关) 木秀林网(主要内容是消息队列)
- vue 循环前十条数据
v-for="(item, index) in items" v-if="index<10"
- 正则化 L1 L2
机器学习中几乎都可以看到损失函数后面会添加一个额外项,常用的额外项一般有两种,一般英文称作ℓ1ℓ1-norm和ℓ2ℓ2-norm,中文称作L1正则化和L2正则化,或者L1范数和L2范数. L1正则化和 ...
- hdu1213并查集
板子题不多说,上代码 #include<iostream> #include<cstdio> #include<cstring> using namespace s ...
- 20165314 2016-2017-2 《Java程序设计》第9周学习总结
20165314 2016-2017-2 <Java程序设计>第9周学习总结 教材学习内容总结 URl类 UDP数据报 广播数据报 套接字 套接字连接机制 代码托管
- Dinner
问题 : Dinner 时间限制: 1 Sec 内存限制: 32 MB 题目描述 Little A is one member of ACM team. He had just won the go ...
- python函数之各种器
一: 装饰器 1:装饰器模板 def wrapper(func): def inner(*args,**kwargs): ret =func(*args,**kwargs) return ret re ...