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



Reply via email to