velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Re: Calling methods in a velocity template
Date Thu, 01 Jun 2006 21:21:51 GMT
"Daniel Pfeifer" <Daniel.Pfeifer@tradedoubler.com> writes:

>I found out what the problem is. Velocity doesn't support inner classes.
>Thanks anyways!

Velocity supports inner classes just fine, as long as they are public
(because they need to be introspected).

	Best regards
		Henning



>/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


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

Social behaviour: Bavarians can be extremely egalitarian and folksy.
                                    -- http://en.wikipedia.org/wiki/Bavaria
Most Franconians do not like to be called Bavarians.
                                    -- http://en.wikipedia.org/wiki/Franconia

---------------------------------------------------------------------
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