JodaTime library not available - @DateTimeFormat not supported
使用spring的@DateTimeFormat来格式化Date类型时,报错:
org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'modelInfoExample' on field 'birthday':
rejected value [2014-12-09];
codes [typeMismatch.modelInfoExample.birthday,typeMismatch.birthday,typeMismatch.java.util.Date,typeMismatch];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable:
codes [modelInfoExample.birthday,birthday]; arguments []; default message [birthday]];
default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date'
for property 'birthday'; nested exception is org.springframework.core.convert.ConversionFailedException:
Failed to convert from type java.lang.String to type @org.springframework.format.annotation.DateTimeFormat
java.util.Date for value '2014-12-09'; nested exception is
java.lang.IllegalStateException: JodaTime library not available - @DateTimeFormat not supported]
很明显,确实 JodaTime 库,在pom.xml中加入其依赖,搞定:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.6</version>
</dependency>
JodaTime library not available - @DateTimeFormat not supported的更多相关文章
- Downloading the Google Cloud Storage Client Library
Google Cloud Storage client是一个客户端库,与任何一个生产环境使用的App Engine版本都相互独立.如果你想使用App Engine Development server ...
- wesome-android
awesome-android Introduction android libs from github System requirements Android Notice If the lib ...
- gradle大体内容
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:grad ...
- 30 个很棒的 PHP 开源 CMS 内容管理系统
本文汇集了30个优秀的开源CMS建站系统,采用PHP开发.以下列表不分先后顺序. 1. AdaptCMS AdaptCMS Lite 是一个开源的CMS系统,主要特点是易用,而且可以轻松和其他系统接驳 ...
- android MultiDex multidex原理下超出方法数的限制问题(三)
android MultiDex 原理下超出方法数的限制问题(三) 插件化?自动化?multiDex?是不是觉得已经懵逼了?请先看这篇文章的内容,在下篇文章中将会详解具体的过程- 随着应用不断迭 ...
- Awesome Big Data List
https://github.com/onurakpolat/awesome-bigdata A curated list of awesome big data frameworks, resour ...
- springmvc配置之mvc:annotation-driven
为了简化springmvc配置,spring同时引入了mvc namespace, 配置了 <mvc:annotation-driven/> spring会默认注册a RequestMap ...
- Robot framework--内置库xml学习(一)
Using lxml By default this library uses Python's standard ElementTree module for parsing XML, but it ...
- Android方法引用数超过65535优雅解决
随着应用不断迭代更新,业务线的扩展,应用越来越大(比如:集成了各种第三方SDK或者公共开源的Library文件.jar文件)这样一来,项目耦合性就很高,重复作用的类就越来越多了,SO:问题就来了.相信 ...
随机推荐
- JS魔法堂:doctype我们应该了解的基础知识
一.前言 什么是doctype?其实我们一直使用,却很少停下来看清楚它到底是什么,对网页有什么作用.本篇将和大家一起探讨那个默默无闻的doctype吧! 二.什么是doctype doctype或DT ...
- python反转字符串(简单方法)及简单的文件操作示例
Python反转字符串的最简单方法是用切片: >>> a=' >>> print a[::-1] 654321 切片介绍:切片操作符中的第一个数(冒号之前)表示切片 ...
- SQL Server添加MDW性能监控报表
10.2 Data Collector与MDW Data Collection功能是SQL SERVER 2005版本提供的数据库监控报表的功能,通过定时地对数据库的语句运行情况,服务器各种资源的监控 ...
- KMP算法详解 --- 彻头彻尾理解KMP算法
前言 之前对kmp算法虽然了解它的原理,即求出P0···Pi的最大相同前后缀长度k. 但是问题在于如何求出这个最大前后缀长度呢? 我觉得网上很多帖子都说的不是很清楚,总感觉没有把那层纸戳破, 后来翻看 ...
- Orleans之Hello World
接触Orleans 有一段时间了,之前也翻译了一系列官网文档,今天我们就来一个实际的例子,来看看到底如何用这个东西来开发项目,当然经典的也是醉人的,我们就从HelloWorld开始吧. 通过前面的知识 ...
- 设置窗体透明C#代码
上个示例是C#调用windows api 在原来代码上加入窗体透明,控件不透明代码: using System; using System.Runtime.InteropServices; using ...
- LODOP打印插件
HTML代码(请先下载对应LODOP插件安装) - 打印onclike事件CreatePrintPage()打印函数,LODOP.PREVIEW()打印预览. <div class=&q ...
- C#中弹出文件选择窗体和判断是否下载提示窗体的源码
1.创建一个window窗体
- 使用PreparedStatement执行SQL语句时占位符(?)的用法
1.Student数据库表 ID name gender 2.Java代码 public static void main(String[] args) { int _id=1; Str ...
- C#中的索引器原理
朋友们,还记得我们在C#语言开发中用到过索引器吗? 记得在获得DataGridView控件的某列值时:dgvlist.SelectedRows[0].Cells[0].Value; 记得在获得List ...