velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Static java classes
Date Mon, 07 May 2007 15:38:23 GMT
On 5/7/07, Sebastian Gumpold <sebastian.gumpold@sbs.co.at> wrote:
> Hi all!
>
> Is it possible to use static classes in a Velocity template?

not without some really ugly, in-template reflection hacks.

> When using
> context.put("bla", instanceOfBla);
> a concrete instance of a class is needed, so this of course doesn't work
> for a static class.

yeah, an instance is needed for normal usage.  adding support for
static utility classes has been discussed for a long time.
unfortunately, we didn't get it done for 1.5, but it is high on my
list of things-i'd-like-to-make-time-for so that we get it into 1.6.
if you're interested in helping, here's the discussion:

http://issues.apache.org/jira/browse/VELOCITY-102

> Thanks a lot,
> Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message