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


Reply via email to