velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Calling methods in a velocity template
Date Wed, 31 May 2006 16:06:22 GMT
actually, Velocity does support inner classes just fine.  i've been
using them in VelocityTools for quite some time.  however, you may
need to make sure that both the outer and inner class are public.  it
might work with a public inner class and non-public outer class, but i
haven't tried that.  at a minimum, the inner class and method
definitely need to be declared public.

On 5/31/06, Daniel Pfeifer <Daniel.Pfeifer@tradedoubler.com> wrote:
> I found out what the problem is. Velocity doesn't support inner classes.
> Thanks anyways!
> /Daniel
>
> -----Original Message-----
> From: Nathan Bubna [mailto:nbubna@gmail.com]
> Sent: den 31 maj 2006 16:21
> To: Velocity Users List
> Subject: Re: Calling methods in a velocity template
>
> to call a method, it must be a public method in a public class.  also,
> make sure your variables have the right type.
>
> $myUtils.class.name
> $variableone.class.name
> $variabletwo.class.name
>
>
> On 5/31/06, Daniel Pfeifer <Daniel.Pfeifer@tradedoubler.com> wrote:
> > I've got following piece of code:
> >
> >
> >
> > $myUtils.encode($variableone,$variabletwo)
> >
> >
> >
> > ($myUtils is a class called MyUtils which I added to the Context by
> > context.put("myUtils", new MyUtils()).
> >
> >
> >
> > Encode is supposed to return a string and takes two strings, however,
> > nothing happens except that
> "$myUtils.encode($variableone,$variabletwo)"
> > is printed to the screen.
> >
> >
> >
> > Why oh why?
> >
> >
> >
> > Thanks in advance,
> >
> > Daniel
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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


Mime
View raw message