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">--%>
<%--&lt;%&ndash;@declare id="userphone"&ndash;%&gt;<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.的更多相关文章

  1. SpringMVC报错The request sent by the client was syntactically incorrect ()

    springmvc数据绑定出的错 在数据绑定的时候一定要主意Controller方法中的参数名和jsp页面里的参数名字是否一致或者按照绑定的规范来写, 如果不一致,可能回报如下错误: The requ ...

  2. "The request sent by the client was syntactically incorrect ()"问题定位及解决:

    Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法: 把spring日志级 ...

  3. The request sent by the client was syntactically incorrect问题解决

    The request sent by the client was syntactically incorrect意思嘛,google翻译一下 通过日志不难看出,是由参数不匹配造成的. 所以对于Da ...

  4. 错误:The request sent by the client was syntactically incorrect的解决

    问题: 错误400-The request sent by the client was syntactically incorrect. springMVC中,某个页面提交时报400错误,如下图. ...

  5. spring mvc 在上传图片时,浏览器报The request sent by the client was syntactically incorrect

    项目中,在一个jsp页面里其它图片上传是功能是可以使用的,当我自己新加了一个图片上传时,提交表单后,浏览器报The request sent by the client was syntactical ...

  6. SpringMVC---400错误The request sent by the client was syntactically incorrect ()

    在SpringMVC中使用@RequestBody和@ModelAttribute注解时遇到了很多问题,现记录下来. @ModelAttribute这个注解主要是将客户端请求的参数绑定参数到一个对象上 ...

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

  8. 又见The request sent by the client was syntactically incorrect ()

    前几天遇到过这个问题(Ref:http://www.cnblogs.com/xiandedanteng/p/4168609.html),问题在页面的组件name和和注解的@param名匹配不对,这个好 ...

  9. 错误The request sent by the client was syntactically incorrect ()的解决

    http://www.cnblogs.com/xiandedanteng/p/4168609.html 这个错误是SpringMVC报出来的,见到它意味着html/jsp页面的控件名称 和 contr ...

随机推荐

  1. .net下使用最小堆实现TopN算法

    测试代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespac ...

  2. 如何学习、了解Kubernetes?

    欢迎访问网易云社区,了解更多网易技术产品运营经验 [Kubernetes官方文档](https://kubernetes.io/docs/tutorials/)是最基本的入门教材,这里的内容是最官方, ...

  3. Python面向对象(成员修饰符)

    day25 成员修饰符 class Foo: def __init__(self, name, age): self.name = name self.__age = age#私有,外部无法直接访问 ...

  4. hdoj1068 Girls and Boys(二分图的最大独立集)

    题意:有n个人,要彼此认识.选择一个集合,使得集合里的每个人相互不认识.求集合中人数的最大值. 求二分图的最大独立集. 公式:最大独立集=顶点数-最大匹配 这个题目中因为集合是一个,所以求出最大匹配数 ...

  5. 验证resneXt,densenet,mobilenet和SENet的特色结构

    简介 图像分类对网络结构的要求,一个是精度,另一个是速度.这两个需求推动了网络结构的发展. resneXt:分组卷积,降低了网络参数个数. densenet:密集的跳连接. mobilenet:标准卷 ...

  6. spring基础回顾

    1.什么是Spring框架?Spring框架有哪些主要模块? Spring框架是一个为Java应用程序的开发提供了综合.广泛的基础性支持的Java平台.Spring帮助开发者解决了开发中基础性的问题, ...

  7. 点击按钮,生成一组一组combobox和slider时,避免控件Id相同,导致控件冲突的方法

    如下效果图,点击一次添加按钮,动态生成一组combobox和slider.由于easyUI的下拉框和滑块使用相同的控件id,通过JS生成控件,如果两个id一样就会造成冲突,例如点击第一组的下拉框,第二 ...

  8. Windows平台下Git服务器搭建--------gitblit

    Windows(server)平台下Git服务器搭建 第一步:下载Java,安装,配置环境变量. 第二步:下载Gitblit.下载地址:http://www.gitblit.com/ 第三步:解压缩下 ...

  9. 我的Git教程 之 初始化本地库

    初始化本地库 前言:这个教程只适用于像我一样大致理解Git的原理,但是不太记得住Git命令的同学使用.所以具体原理只会提一下,具体可以参见Pro Git.同时,下面的操作需要先安装相应的Git工具,具 ...

  10. 快速初步了解Neo4j与使用

    快速初步了解Neo4j与使用 Neo4j是一个高性能的,NOSQL图形数据库,它将结构化数据存储在网络上而不是表中.它是一个嵌入式的.基于磁盘的.具备完全的事务特性的Java持久化引擎,但是它将结构化 ...