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问题解决的更多相关文章

  1. 【报错】Validation failed for object='userLogin'. Error count: 1

    提交表单之后: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing ...

  2. gitment Error:validation failed错误解决办法

    点击Initialize comments 突然跳转出一个错误Error:validation failed 经查阅之后发现 issue的标签label有长度限制!labels的最大长度限制是50个字 ...

  3. Object type TYPE failed to create with error

    ORA-39083: Object type TYPE failed to create with error: ORA-02304: invalid object identifier litera ...

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

  5. ORA-19563: header validation failed for file

    在测试服务器还原数据库时遇到了ORA-19563错误.如下所示 RMAN-00571: ======================================================== ...

  6. Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法

    Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法 You can extract all the ...

  7. Validation failed for query for method

    问题原因 sql语法,使用@Query("select id, username, usersex, userphone from User where User.usersex = ?1& ...

  8. Oracle sqlldr导入之“MAXIMUM ERROR COUNT EXCEEDED”

    昨天看到一个同事在通过PL/SQL Developer工具把文本数据往oracle表;有两个文本:一个有30万条记录:一个7万多条记录.在导入到过程中:出现错误记录还需要点击确认.不过使用黑科技(屏幕 ...

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

随机推荐

  1. Linux 操作系统死机故障处理方法总结

    通常在出现系统崩溃后,大家会担心再次出现故障,但是发现系统各日志中并没有记录到任何死机前后的信息,无法分析故障原因,认为已经无药可救.但是,实际上,Linux 有多种机制来保证发生系统崩溃后,可以获取 ...

  2. .NET NPOI操作Excel 让单元格的内容换行

    HSSFWorkbook workbook = new HSSFWorkbook(); // 工作簿 ISheet sheet = workbook.CreateSheet("会员列表&qu ...

  3. Vue-tab选项卡

    <div id='test'> <ul class="nav" > <li v-for='(item,index) in dataNav' @clic ...

  4. ant 相关命令

    # jmeter-ant A Simple Ant project for JMeter Performance Test # Pre-Requisite* Java 1.7 or above* JM ...

  5. Confluence 6 在 Apache 或者系统级别阻止垃圾

    如果一个垃圾发布机器人攻击你的 Confluence 站点,这些程序可能来自于同一个 IP 地址,或者是一个比较小范围的 IP 地址段.希望找到攻击者的 IP 地址,请参考 Apache access ...

  6. 进入页面,根据后台传过来的flag 判断列表隐藏与否

    需求描述:页面中有两个列表,一个已添加,一个可以添加,进入页面的时候,如果已添加中有数据则显示,没有数据就隐藏,emmmm,这种需求,我该怎么吐槽嗷嗷嗷 解决思路:让已添加的列表的div默认隐藏,前台 ...

  7. JSP 隐式对象

    一. 隐式对象 JSP隐式对象 对象 类型 request javax.servlet.http.HttpServletRequest response javax.servlet.http.Http ...

  8. vue 的动画

    1.vue 的动画流程分为enter,和leave分别对应以下两幅图 <!doctype html><html lang="en"><head> ...

  9. node.js 框架express关于报错页面的配置

    1.声明报错的方法,以及相对应的页面 //把数据库的调用方法配置到请求中 server.use((req, res, next) => { //把数据库存入req中 req.db = db; / ...

  10. Little Red Riding Hood

    问题 : Little Red Riding Hood 时间限制: 1 Sec  内存限制: 1280 MB 题目描述 Once upon a time, there was a little gir ...