velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <>
Subject Re: String to Int
Date Tue, 10 Dec 2002 12:27:16 GMT

On Tuesday, December 10, 2002, at 06:36 AM, Peter Romianowski wrote:

> You cannot call static Methods from VTL. Rewrite your class to:

That's not true, depending on what you mean.  If you place an instance 
of the class in the context, you certainly can call static methods :

With the class

         public static class StaticClass
                 public static String statMethod()
                         return "I am a static method";


         context.put("mystatic", new StaticClass());

with  a template


I get

    I am a static method

Geir Magnusson Jr                                   203-355-2219(w)
Adeptra, Inc.                                       203-247-1713(m)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message