Once I had to publish ErrorCodes "constants" to
templates (ErrorCodes.INVALID_KEY etc...). Use
FieldMethodizer wrapper to publish constant fields.

ctx.put("ErrorCodes", new
FieldMethodizer(ErrorCodes));

And if you need access to static methods then can
always add a default constructor that does nothing.

ctx.put("Utils", new Utils());

If you dont want to add constructor to a pure static
class, FieldMethodizer may work for static methods as
well. I never tried it.

--- Sebastian Gumpold <[EMAIL PROTECTED]>
wrote:

> Hi all!
> 
> Is it possible to use static classes in a Velocity
> template?
> 
> 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.
> 
> Thanks a lot,
> Sebastian

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to