cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Berens" <rber...@osirion.nl>
Subject Re: [JXTemplate] expression is not evaluated?
Date Mon, 28 Nov 2005 11:22:34 GMT

----- Original Message ----- 
From: "Mark Lundquist" <ml@wrinkledog.com>
To: <dev@cocoon.apache.org>
Sent: Monday, November 28, 2005 10:09 AM
Subject: Re: [JXTemplate] expression is not evaluated?


> Yes — it's because inside '${}', the language is JExL, and you are
> trying to treat it as Java.  The meaning of:
>
> ${java.util.Date()}
>
> is "take the result of calling the method named 'Date' of the property
> named 'util' of the object named 'java' in my context".  JExL doesn't
> know about constructors nor about the Java package syntax.
>

I can write

<jx:set var="myList" value="${java.util.List()}"/>

which works fine in 2.1.8. Also you can use Packages to write something like

${Packages.com.myCompany.myPackage.myClass(myParameter1, myParameter2)}

This works because the JXTG adds "java" and "Packages" to the Jexl context,
which are variables of the class org.mozilla.javascript.NativeJavaPackage.

So it's not a Jexl problem.

Rob Berens
Osirion B.V.


Mime
View raw message