[webbeans-dev] Question about parsing Date fields in XML based metadata
Mark Struberg
struberg at yahoo.de
Tue Jan 6 19:40:34 EST 2009
Hi!
It's a bit late so please excuse me if my thoughts/sentences are a bit weird.
The web_beans-1.0-pr-spec has the following definition in section 9.2.5:
> The initial value of a field of type java.util.Date or
> java.util.Calendar is specified using a format that can be
> parsed by java.text.DateFormat.getDateTimeInstance().parse().
Now my question: DateFormat.getDateTimeInstance() is Locale aware. This may not always be positive.
I'm working on international projects, and if I build a WAR in vienna (Locale de_AT), and my colleagues in mountain view (Locale US) and Bangalore (maybe Locale hi_IN) like to deploy it, then it's very likely that they get parsing exceptions for e.g. default values provided via web-beans XML definition, isn't it?
Shouldn't we better use e.g. the xs:dateTime format like in SOAP?
http://www.w3.org/TR/xmlschema-2/#dateTime
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Another question:
Let's say I have a Calendar field in MyWebBean.java. Which kind of Calendar should it actually inject? GregorianCalendar? Or should it throw a DefinitionException? (Generall question about handling of abstract members)
txs in advance and LieGrue,
strub
----------------------------------------------------------------
“Multiple exclamation marks are a sure sign of a diseased mind!”
(Sir Terry Pratchett)
More information about the weld-dev
mailing list