The request sent by the client was syntactically incorrect.
HTTP Status 400 -
type Status report
message
description The request sent by the client was syntactically incorrect.
Apache Tomcat/7.0.77
description:由客户端发送的请求是语法上是不正确的
关于这个400-,大部分都是说前端jsp页面的控件名称(name)和controller中接收的参数名称不一致,有这个原因,今天我想记录的是除了这个原因之外还有一个原因就是jsp页面上的某些实体参数标签是不能展示的,因为它根本就没有进到control层
这是我的修改用户信息control
@RequestMapping(value = "/updateUserInfo", method = RequestMethod.POST)
public String updateUserInfo(User user, RedirectAttributes redirectAttributes) {
User newUser = user;
userService.updateUserByUserName(newUser);
redirectAttributes.addAttribute("username", newUser.getUserName());
return "redirect:listUserInfo";
} jsp页面的userPhone与control层的userPhone不一致,我只能暂时先注释掉userPhone
<%--<tr>--%>
<%--<td class="mdl-data-table__cell--non-numeric">用户电话:</td>--%>
<%--<td>--%>
<%--<div class="mdl-textfield mdl-js-textfield">--%>
<%--<%–@declare id="userphone"–%><input class="mdl-textfield__input" type="text" pattern="-?[0-9]*(\.[0-9]+)?"--%>
<%--name="userPhone"--%>
<%--value="${user.userPhone}">--%>
<%--<label class="mdl-textfield__label" for="userPhone"></label>--%>
<%--</div>--%>
<%--</td>--%>
<%--</tr>--%>
然后问题锁定在userPhone这里,现在就是抓住这个userPhone参数来进行调试,参考了这篇文章:https://cuisuqiang.iteye.com/blog/2054234
然后参考了这篇文章springmvc form表单提交报400错误:https://blog.csdn.net/zlsdmx/article/details/54923422
此文章描述了日期类型和integer类型前台和后台数据库传参报错的问题,举例了日期类型在实体类中的修改方法,但是整数类型的电话号码有所不同,但是我可以把数据库中的电话号码类型换成vachar类型,这样就可以了 综上所述,springmvc form表单提交报400错误不一定是前台表单的参数与control层参数不一致,也有可能是数据库中字段如日期,电话的类型与表单需要的类型不一致,需要在类型方面做修改
The request sent by the client was syntactically incorrect.的更多相关文章
- SpringMVC报错The request sent by the client was syntactically incorrect ()
springmvc数据绑定出的错 在数据绑定的时候一定要主意Controller方法中的参数名和jsp页面里的参数名字是否一致或者按照绑定的规范来写, 如果不一致,可能回报如下错误: The requ ...
- "The request sent by the client was syntactically incorrect ()"问题定位及解决:
Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法: 把spring日志级 ...
- The request sent by the client was syntactically incorrect问题解决
The request sent by the client was syntactically incorrect意思嘛,google翻译一下 通过日志不难看出,是由参数不匹配造成的. 所以对于Da ...
- 错误:The request sent by the client was syntactically incorrect的解决
问题: 错误400-The request sent by the client was syntactically incorrect. springMVC中,某个页面提交时报400错误,如下图. ...
- spring mvc 在上传图片时,浏览器报The request sent by the client was syntactically incorrect
项目中,在一个jsp页面里其它图片上传是功能是可以使用的,当我自己新加了一个图片上传时,提交表单后,浏览器报The request sent by the client was syntactical ...
- SpringMVC---400错误The request sent by the client was syntactically incorrect ()
在SpringMVC中使用@RequestBody和@ModelAttribute注解时遇到了很多问题,现记录下来. @ModelAttribute这个注解主要是将客户端请求的参数绑定参数到一个对象上 ...
- HTTP Status 400 - description The request sent by the client was syntactically incorrect.
HTTP Status 400 - type Status report message description The request sent by the client was syntacti ...
- 又见The request sent by the client was syntactically incorrect ()
前几天遇到过这个问题(Ref:http://www.cnblogs.com/xiandedanteng/p/4168609.html),问题在页面的组件name和和注解的@param名匹配不对,这个好 ...
- 错误The request sent by the client was syntactically incorrect ()的解决
http://www.cnblogs.com/xiandedanteng/p/4168609.html 这个错误是SpringMVC报出来的,见到它意味着html/jsp页面的控件名称 和 contr ...
随机推荐
- PhoneGap原理
http://www.oschina.net/question/213217_46380
- jxl库介绍
jxl是个韩国人开发的java中操作excel的库(棒子国思密达) 相对于另一个java excel库poi来说,jxl具有小巧和使用简单等优点. File uploadedFile = new Fi ...
- Map-560. Subarray Sum Equals K
Given an array of integers and an integer k, you need to find the total number of continuous subarra ...
- 鬼知道是啥系列之——STL(lower_bound(),upper_bound() )
引子,不明觉厉: 百度,渐入佳境: 头铁,入门到放弃: lower_bound(): 头文件: #include<algorithm>函数功能: 函数lower_bound()在f ...
- spring-security(2)
记录一下spring security的配置 配置详解 <?xml version="1.0" encoding="UTF-8"?> <bea ...
- python打造渗透工具集
python是门简单易学的语言,强大的第三方库让我们在编程中事半功倍,今天我们就来谈谈python在渗透测试中的应用,让我们自己动手打造自己的渗透工具集. 难易程度:★★★阅读点:python;web ...
- PHP之旅8 URL与表单
表单 表单的出现让用户和后台主机有了直接的交互,网站开始变的‘动态起来’,在HTML的各个标记符中,与PHP关系最为紧密的要属表单标记符了,常见的表单标记符有<form>.<inpu ...
- centos7在分区上建立文件系统和挂载
在上一篇博客中,我们只说了硬盘的分区,既然进行分区,那么我们就要知道如何使用这些分区,就是接下来的建立文件系统和挂载. mkfs(make filesystem)格式化,建立文件系统 可以看到各种文件 ...
- Gson简单使用
最近做个IM类型的Android 应用,由于有三种客户端(pc,ios,Android),所以底层使用的是C++与服务器通信,所以通信部分基本上有c++完成,封装好Jni即可,可以把底层c++通信看成 ...
- iOS完全自学手册——[一]Ready?No!
1.前言 今天开始我会不定期写一些iOS自学的相关文章.毕竟,自己是自学开始,知道自学有哪些坑,知道自学对于开发欠缺什么,此外,加上现在的实际开发经验,希望能给自学的iOS开发者一些建议. 2.Rea ...