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 ...
随机推荐
- Hessian——轻量级远程调用方案
Hessian是caucho公司开发的一种基于二进制RPC协议(Remote Procedure Call protocol)的轻量级远程调用框架.具有多种语言的实现,但用的最多的当然是Java实现 ...
- kolla-ansible 源码下载
下载地址: https://pypi.org/project/kolla-ansible/ ansible下载: https://releases.ansible.com/ansible/rpm/re ...
- Alamofire源码导读二:发起请求及内部加锁的逻辑
以创建一个 DataRequest 为例子  发起请求 创建 SessionManager 顺带也创建了一个 SessionDelegate 持有一个urlSession,持有一个串行的 Dispa ...
- WebDriverAPI(4)
单击某个元素 采用元素id.click()方法即可 双击某个元素id.doubleClick 操作单选下拉列表 测试网页HTML代码 <html> <body> <sel ...
- Jmeter中文乱码
方法一 添加后置管理器BeanShell PostProcessor 填入prev.setDataEncoding("UTF-8") 方法二 在请求的 Content encodi ...
- 支付宝小程序自定义弹窗插件|支付宝dialog插件|model插件
支付宝小程序自定义弹窗组件wcPop|小程序自定义对话框|actionSheet弹窗模板 支付宝小程序官方提供的alert提示框.dialog对话框.model弹窗功能比较有限,有些都不能随意自定义修 ...
- yolov3源码分析keras(一)数据的处理
一.前言 本次分析的源码为大佬复现的keras版本,上一波地址:https://github.com/qqwweee/keras-yolo3 初步打算重点分析两部分,第一部分为数据,即分析图像如何做等 ...
- Java之IO(十一)BufferedReader和BufferedWriter
转载请注明源出处:http://www.cnblogs.com/lighten/p/7074488.html 1.前言 按照字节流的顺序一样,字符流也提供了缓冲字符流,与字节流不同,Java虽然提供了 ...
- sql子查询在insert、update、delete中的应用
子查询可以应用在INSERT.UPDATE以及DELETE等语句中,合理的使用子查询将能够简化功能的实现并且极大的提高SQL语句执行的效率 用到的表: CREATE TABLE `t_readerfa ...
- java的Arrays工具类
1年多了,jdk还不是很熟,补补. package lhy.core.util; import java.util.Arrays; import java.util.List; public clas ...