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 Tue, 05 Aug 2003 18:24:48 GMT
Ugo Cei wrote:

> Ugo Cei wrote:
>
>> org.apache.commons.jxpath.JXPathException: Cannot invoke public final 
>> java.lang.String java.text.Format.format(java.lang.Object); Cannot 
>> format given Object as a Date
>
>
> More info: printing 
> #{getClass(myXPathExpressionThatShouldPointToADate)} yelds:
>
> class org.apache.commons.jxpath.ri.EvalContext$SimpleNodeSet
>
>     Baffled,
>
>         Ugo
>
What was your expression?

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)}'/>

As in JavaScript, classes in packages other than "java" are under the 
"Packages" property, for example:
 
  <jx:out 
value='${Packages.com.xyz.text.MyClass(blah).someMethod(blah)}'/> is 
equivalent to:

new com.xyz.myClass(blah).someMethod(blah);


Chris


Mime
View raw message