SpringMVC中的400错误,The request sent by the client was syntactically incorrect.
在其他对象属性类型一样情况下,只需要创建一个类,再在springmvc.xml中添加配置:
- package com.ujiuye.common;
- import org.springframework.core.convert.converter.Converter;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- public class DateTimeConverter implements Converter<String, Date> {
- public Date convert(String s) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- try{
- Date date = sdf.parse(s);
- return date;
- }catch (Exception ex){
- System.out.println(ex.getMessage());
- return null;
- }
- }
- }
- <!--全局类型转型器-->
- <bean id="converter" class="com.ujiuye.common.DateTimeConverter"></bean>
- <bean id="formattingConversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
- <property name="converters">
- <set>
- <ref bean="converter"></ref>
- </set>
- </property>
- </bean>
- <mvc:annotation-driven conversion-service="formattingConversionService"/>
- <mvc:annotation-driven/>
SpringMVC中的400错误,The request sent by the client was syntactically incorrect.的更多相关文章
- 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 ...
- 错误400-The request sent by the client was syntactically incorrect
springMVC中,某个页面提交时报400错误,如下图. 解决方法: 1.在网上找了一下,答案是通常遇到这个错误是因为前端jsp页面的控件名称和controller中接收的参数名称不一致.但 ...
- 错误The request sent by the client was syntactically incorrect ()的解决
http://www.cnblogs.com/xiandedanteng/p/4168609.html 这个错误是SpringMVC报出来的,见到它意味着html/jsp页面的控件名称 和 contr ...
- 错误:The request sent by the client was syntactically incorrect的解决
问题: 错误400-The request sent by the client was syntactically incorrect. springMVC中,某个页面提交时报400错误,如下图. ...
- SpringMVC报错The request sent by the client was syntactically incorrect ()
springmvc数据绑定出的错 在数据绑定的时候一定要主意Controller方法中的参数名和jsp页面里的参数名字是否一致或者按照绑定的规范来写, 如果不一致,可能回报如下错误: The requ ...
- 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问题解决
The request sent by the client was syntactically incorrect意思嘛,google翻译一下 通过日志不难看出,是由参数不匹配造成的. 所以对于Da ...
- spring mvc 在上传图片时,浏览器报The request sent by the client was syntactically incorrect
项目中,在一个jsp页面里其它图片上传是功能是可以使用的,当我自己新加了一个图片上传时,提交表单后,浏览器报The request sent by the client was syntactical ...
随机推荐
- Elasticsearch 报错:Fielddata is disabled on text fields by default. Set `fielddata=true` on [`your_field_name`] in order to load fielddata in memory by uninverting the inverted index.
Elasticsearch 报错: Fielddata is disabled on text fields by default. Set `fielddata=true` on [`your_fi ...
- Linux下使用cx_Oracle的一些配置
在安装完成cx_Oracle后,import cx_Oracle时报错,首先查看.bash_profile文件中环境变量配置 # .bash_profile # Get the aliases an ...
- socket套接字及粘包问题
socket套接字 1.什么是socket socket是一个模块,又称套接字,用来封装互联网协议(应用层以下的层) 2.为什么要有socket 实现应用层以下的层的工作,提高开发效率 3.怎么使用s ...
- hbase表的高性能设计
第7章 HBase优化 7.1 高可用 在HBase中Hmaster负责监控RegionServer的生命周期,均衡RegionServer的负载,如果Hmaster挂掉了,那么整个HBase集群将陷 ...
- 防御流类型的xss攻击
1.建立一个工具类 package im.lsn.oss.exhibition.utils; import org.apache.commons.lang3.StringUtils; import j ...
- LeetCode 825. Friends Of Appropriate Ages
原题链接在这里:https://leetcode.com/problems/friends-of-appropriate-ages/ 题目: Some people will make friend ...
- 说几条JavaScript的基本规范
1.不要在同一行声明多个变量 2.使用===或!==来比较 3.使用字面量的方式来创建对象.数组,替代new Array这种形式 4.不要使用全局函数 5.switch语句必须要带default分支 ...
- Flask视图之CBV示列
from flask import views, Flask app=Flask(__name__) class loginview( views.MethodView ): # 继承views. ...
- 使用golang写一个redis-cli
使用golang写一个redis-cli 0. redis通信协议 redis的客户端(redis-cli)和服务端(redis-server)的通信是建立在tcp连接之上, 两者之间数据传输的编码解 ...
- c++功能与方法笔记
1. windows判断创建目录 #include <Shlwapi.h> #pragma comment(lib, "shlwapi.lib") //windows ...