cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Pattern convertor - Bug?
Date Tue, 01 Mar 2005 08:49:54 GMT
Reinhard Poetz wrote:

>
> If I use a pattern convertor according to the documentation
>
> <fd:convertor type="formatting">
>   <fd:patterns>
>     <fd:pattern>MM/dd/yyyy</fd:pattern>
>     <fd:pattern locale="nl-BE">dd/MM/yyyy</fd:pattern>
>     <fd:pattern locale="fr">dd-MM-yyyy</fd:pattern>
>   </fd:patterns>
> </fd:convertor>
>
> I get following exception:
>
> java.lang.IllegalArgumentException: Illegal pattern  character 'd'
>     at 
> java.text.SimpleDateFormat.translatePattern(SimpleDateFormat.java:1737)
>     at 
> java.text.SimpleDateFormat.applyLocalizedPattern(SimpleDateFormat.java:1792) 
>
>     at 
> org.outerj.i18n.JdkDateFormat.applyLocalizedPattern(JdkDateFormat.java:23) 
>
>     at 
> org.apache.cocoon.forms.datatype.convertor.FormattingDateConvertor.getDateFormat(FormattingDateConvertor.java:109)

>
>
>
> (I've modified the birthday widget of our 'form1'-example and I'm 
> using trunk checked-out yesterday. I've noticed the same problem in a 
> 4 weeks old 2.2 checkout too.)
>
> Any ideas what's wrong here? Is it a bug or my mistake?


Remove icu4j.jar from your WEB-INF/lib and retry. The date convertor 
currently automatically uses icu4j if present and DateFormat otherwise. 
This leads to this kind of weirdness because of the differences between 
the two.

I plan to separate them, the current "formatting" convertor using 
SimpleDateFormat and a new "icu4j" convertor using... icu4j!

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message