[webbeans-dev] Question about parsing Date fields in XML based metadata

Gavin King gavin at hibernate.org
Wed Jan 7 06:41:24 EST 2009


Thanks Mark, fwding to the group.

On Wed, Jan 7, 2009 at 11:40 AM, Mark Struberg <struberg at yahoo.de> wrote:
> 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)
>
>
>
>
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list