You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jaume Soriano <js...@es.wanadoo.com> on 2001/08/24 14:06:25 UTC
RE: New in this list, first doubt! :-)
SORRY!!
The problem was that i've included the declaration
of the class 'MyPublicClass' in the same file
as the servlet :-P
The problem has been solved!
Thanks Bojan and excuse me again!
-----Mensaje original-----
De: bojan@binarix.com [mailto:bojan@binarix.com]
Enviado el: viernes, 24 de agosto de 2001 13:51
Para: velocity-user@jakarta.apache.org
Asunto: Re: New in this list, first doubt!
Jaume Soriano wrote:
>
> More code?
> Here you are:
> In the java file:
> ...
> Vector myvector = new Vector();
> String cad = new String("Hello world");
>
> myvector.addElement(cad);
>
> ctx.put("List",myvector);
>
> MyPublicClass mpc = new MyPublicClass();
> ctx.put("MPC",mpc);
> ...
>
> In the template:
>
> ...
> $foreach($item in $List)
> <B>$item</B> <BR>
> $end
>
> It WORKS!!! but...
> $MPC.myMethod()
> or
> $MPC.myproperty
> doesn't
> ..
> What am i doing wrong?
Can you show the declaration of the above myMethod()?
Bojan
Re: New in this list, first doubt! :-)
Posted by Bojan Smojver <bo...@binarix.com>.
Jaume Soriano wrote:
>
> SORRY!!
> The problem was that i've included the declaration
> of the class 'MyPublicClass' in the same file
> as the servlet :-P
>
> The problem has been solved!
> Thanks Bojan and excuse me again!
Not to worry. As long it works...
Bojan