velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@adeptra.com>
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";
                 }
         }

and

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

with  a template

     $mystatic.statMethod()

I get

    I am a static method

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


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


Mime
View raw message