cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: JXTemplate - calling static functions
Date Tue, 09 Aug 2005 16:54:54 GMT
David wrote:
> Is it possible to do something like the following in jxtemplates:
> ${org.apache.commons.lang.StringEscapeUtils.escapeXml('test')}

use
${Packages.org.apache.commons.lang.StringEscapeUtils.escapeXml('test')}

BTW: there is no need to use xml escaping for strings in JXTG.

> If not, what is the recommended way of calling a static function on 
> something in JXTemplate?
> 
> 2nd question. The example above doesn't work but I also do not get an 
> error. Should there be an error? Where should it be?

There should be an exception but for some reasons JEXL totally ignores 
leniency settings. It looks in page template object model for variable 
named "org". When not found it just returns null.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message