cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Garbage or The Quest for the Perfect Template Language
Date Wed, 06 Aug 2003 18:43:02 GMT
That's a problem with JXTemplateGenerator: it returns a raw 
java.lang.Class object from "java.util.Locale" which doesn't have a 
property "ITALIAN". I'll try to fix that so it returns a wrapped Class 
object that shows static fields as properties as in JavaScript.

In general, I think you're right, though, JXTemplate generator requires 
additional tags to support Number, Date, and Message formatting. JSTL 
has such tags. If I have time I'll try to add them.

Regards,

Chris

Ugo Cei wrote:

> Christopher Oliver wrote:
>
>> By the way JXTemplateGenerator adds the capability to call Java 
>> constructors to Jexl, so you can also do this:
>>
>>  <jx:out 
>> value='${java.text.SimpleDateFormat("dd/MM/yyyy").format(someDate)}'/>
>
>
> OK, this works:
>
> ${java.text.SimpleDateFormat("dd/MM/yyyy").format(date)}
>
> But this does not:
>
> ${java.text.SimpleDateFormat("dd/MM/yyyy",java.util.Locale.ITALIAN).format(date)} 
>
>
> and gives the following error:
>
> The choice of Java constructor java.text.SimpleDateFormat matching 
> JavaScript argument types (string,null) is ambiguous; candidate 
> constructors are: (java.lang.String,java.text.DateFormatSymbols), 
> (java.lang.String,java.util.Locale)
>
> Problem with static members?
>
>     Ugo
>



Mime
View raw message