<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Converting String to Date and Date-formatting in Spring-MVC</title>
	<link>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/</link>
	<description>My surface interval on the internet.</description>
	<pubDate>Fri, 05 Sep 2008 22:38:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>

	<item>
		<title>By: ccerb</title>
		<link>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-1819</link>
		<author>ccerb</author>
		<pubDate>Wed, 20 Feb 2008 17:31:41 +0000</pubDate>
		<guid>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-1819</guid>
		<description>I solved the problem myself already by reading Spring's source code this morning. When using PropertyEditor-s and when users are providing values which can't be converted to the expected type, Spring produces exceptions of type TypeMismatchException which are error coded, ie they implement ErrorCoded interface. The error code produced for an invalid startDate, for example, would be (by default) "typeMismatch.command.startDate" which you can map thru messages.properties file to a user-friendly message etc. There's more to it, but this is the idea. Good luck!</description>
		<content:encoded><![CDATA[<p>I solved the problem myself already by reading Spring&#8217;s source code this morning. When using PropertyEditor-s and when users are providing values which can&#8217;t be converted to the expected type, Spring produces exceptions of type TypeMismatchException which are error coded, ie they implement ErrorCoded interface. The error code produced for an invalid startDate, for example, would be (by default) &#8220;typeMismatch.command.startDate&#8221; which you can map thru messages.properties file to a user-friendly message etc. There&#8217;s more to it, but this is the idea. Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ccerb</title>
		<link>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-1817</link>
		<author>ccerb</author>
		<pubDate>Wed, 20 Feb 2008 01:11:58 +0000</pubDate>
		<guid>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-1817</guid>
		<description>Do you have any idea how can the message displayed for invalid dates customized? Currently I happen to use exactly the same approach as you suggested. But when invalid dates are typed in such as 27-07-xxxx, I get this message: 

Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property startDate; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "27-07-xxxx"

Is there a way to control this message and replace it with something more user-friendly?

Thanks.
CC</description>
		<content:encoded><![CDATA[<p>Do you have any idea how can the message displayed for invalid dates customized? Currently I happen to use exactly the same approach as you suggested. But when invalid dates are typed in such as 27-07-xxxx, I get this message: </p>
<p>Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property startDate; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: &#8220;27-07-xxxx&#8221;</p>
<p>Is there a way to control this message and replace it with something more user-friendly?</p>
<p>Thanks.<br />
CC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lijin</title>
		<link>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-39</link>
		<author>Lijin</author>
		<pubDate>Sat, 17 Feb 2007 07:33:09 +0000</pubDate>
		<guid>http://blog.deinum.biz/2007/02/09/converting-string-to-date-and-date-formatting-in-spring-mvc/#comment-39</guid>
		<description>Hi Sir,

Nice site and really helpful to me to learn more in Spring. Thanks for your effort.

Lijin</description>
		<content:encoded><![CDATA[<p>Hi Sir,</p>
<p>Nice site and really helpful to me to learn more in Spring. Thanks for your effort.</p>
<p>Lijin</p>
]]></content:encoded>
	</item>
</channel>
</rss>
