`
阅读更多

The request sent by the client was syntactically incorrect.

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

蕃薯耀 2015年8月14日 16:26:11 星期五
http://fanshuyao.iteye.com/

 

spring校验出错,但后台没有错误提示,页面显示

 

@RequestMapping(value="/testValidate")
	public String testValidate(@Valid Student student, Map<String,Object> map,
			BindingResult bindingResult){
		System.out.println("testValidate--");
		if(bindingResult.hasErrors()){
			return "validate";
		}
		return "success";
	}

 

 

 

 

 

 

HTTP Status 400 -

 


 

type Status report

 

message

 

description The request sent by the client was syntactically incorrect.

 

 

 

 

 

 

 

 

 

错误原因:参数顺序

 

 

 

 

public String testValidate(@Valid Student student, Map<String,Object> map,
   BindingResult bindingResult)

 

在这个方法中,@Valid标识需要校验的student和参数bindingResult之间相隔了一个参数map,导致出现上面的错误,但控制台没有报错。

 

 

这种校验方式是有一个约定的,就是BindingResult必须紧随@valid之后。

 把中间的那个参数去掉程序就正常了。

 

 

 

 

 

 

 

 

 

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

 

蕃薯耀 2015年8月14日 16:26:11 星期五
http://fanshuyao.iteye.com/

 

 

 

 

1
1
分享到:
评论

相关推荐

    servlet2.4doc

    The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. doGet...

    SSD7 选择题。Multiple-Choice

    (c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) writing an English description of the data that the user...

    Extended Backus Naur Form

    It was developed as an extension of the original Backus Naur Form (BNF) by John Backus and Peter Naur in the 1960s. EBNF provides a more detailed and flexible method for defining the structure of a ...

    MIBBrowser8.rar

    the SNMP Trap and SNMP Inform packets that were sent from arbitrary SNMP devices or applications on the network. MIB Browser can monitor several SNMP devices simultaneously and contains features like...

    Design Concepts in Programming Languages

    The book's unique approach is based on a family of syntactically simple pedagogical languages that allow students to explore programming language concepts systematically. It takes as premise and ...

    CSS: The Missing Manual, 4th Edition

    ### CSS: The Missing Manual, 4th Edition - 关键知识点概览 #### 一、基础知识:HTML与CSS的结合 - **HTML5标签**:本书首先介绍了如何编写友好的HTML代码,特别是那些被现代浏览器所识别和支持的HTML5标签。这...

    Pragmatic Guide to Sass 3

    《Pragmatic Guide to Sass 3》是一本由Hampton Lintorn Catlin与Michael Lintorn Catlin共同编写的关于Sass(Syntactically Awesome Style Sheets)的专业指南。本书旨在帮助前端开发者更好地理解和运用Sass这一...

    tog-card-client

    【tog-card-client】是一个项目模板,它为开发React应用程序提供了一个基础框架,使用了现代前端技术栈,包括Typescript、Tailwind CSS、SASS、ESLint和Prettier。这个项目旨在帮助开发者快速启动一个新的React项目...

    The-First-Timers

    【标题】:“The-First-Timers”:一个关于幻想足球联赛的项目 在这个名为"The-First-Timers"的项目中,我们看到的是一场充满激情的幻想体育活动,特别是聚焦于足球领域的“第一个计时器”联赛。这个联赛已经进入了...

    Java.EE.and.HTML5.Enterprise.Application.Development

    Employ Syntactically Awesome Stylesheets, CSS3, and Sassy CSS Table of Contents Chapter 1 Introduction to Java EE and HTML5 Enterprise Development Chapter 2 Persistence Chapter 3 RESTful Resources ...

    man-in-the-mirror

    当与React结合使用时,CSS模块可以导入SASS(Syntactically Awesome Style Sheets)文件,这是一种预处理器,扩展了CSS,增加了变量、嵌套规则、混合等功能。SASS文件可以编译成普通的CSS,然后作为模块在JavaScript...

    Android代码-AQuery

    AQuery is a lightweight library that allows UI manipulation in a syntactically similar way to the Javascript library JQuery. AQuery aims to remove the boilerplate code that comes with UI manipulation ...

    The12thAstronaut.github.io:网站存储库

    "SCSS"是Sass(Syntactically Awesome Style Sheets)的预处理器,它扩展了CSS语言,引入了变量、嵌套规则、混合、函数等特性,使得CSS编写更易于维护和扩展。SCSS文件可以被编译成标准的CSS格式,供浏览器解析使用...

    mern-azure-client

    标题"Mern-azure-client"揭示了我们正在讨论的是一个基于MERN栈的项目,它已经集成了Azure服务,特别是客户端部分。MERN是MongoDB、Express.js、React和Node.js的首字母缩写,是一种流行的JavaScript全栈开发框架。...

    The Bootstrap

    通过Sass(Syntactically Awesome Stylesheets)预处理器,可以调整颜色、字体、间距等变量,轻松创建独特的品牌形象。 5. **JavaScript插件**:除了基本的CSS组件,Bootstrap还包含了一系列基于jQuery的JavaScript...

    快速JSON序列化Easyjson.zip

    such cases, so that they may be fixed sooner.Unsafe package is used by the code. While a non-unsafe version of easyjson can be made in the future, using unsafe package simplifies a lot of code by...

    the-twelve-men

    8. **预处理器**:如Sass(Syntactically Awesome Style Sheets)和Less,它们扩展了CSS的功能,引入变量、嵌套规则、混合(mixins)等特性,使得CSS代码更加模块化和可维护。 9. **CSS规范与版本**:CSS不断发展,...

    Modern-HTML-CSS-From-The-Beginning-Including-Sass-:布拉德·特拉弗斯(Brad Traversy)的课程

    然后,课程的重点转向Sass(Syntactically Awesome Style Sheets),这是一个强大的CSS预处理器,它可以引入变量、嵌套规则、混合、函数等高级特性,使得CSS代码更加简洁、可维护。学习者将了解如何安装和设置Sass...

Global site tag (gtag.js) - Google Analytics