[jsr-314-open] default converter for java.util.Date type

Dan Allen dan.j.allen at GMAIL.COM
Tue Mar 31 01:11:19 EDT 2009


Issue 494 (
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=494)
seemed to have fallen off the map, but since I just implemented a solution
in Seam, I have decided to bring it back up. It's really inconvenient not to
have at least a default converter for the type java.util.Date. While
certainly dates inputs are something which vary widely, it's tedious in the
early stages of an application to have to plug a DataTimeConverter on every
input that accepts a date.

The solution is as simple as registering DateTimeConverter with the class
java.util.Date and accepting the defaults. The developer can simply specify
a nested <f:convertDateTime> to override. The main limitation is that there
is no way to know if the developer intends to capture a date or date + time
since the type java.util.Date doesn't provide this information. Thus, we
capture date and let the user specify a converter otherwise.

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090331/921f0963/attachment.html 


More information about the jsr-314-open-mirror mailing list