[Yanel-dev] Using Jelly

Michael Wechner michael.wechner at wyona.com
Mon Apr 7 08:54:35 CEST 2008


Evaldas Taroza wrote:

> Michael Wechner wrote:
>
>> Hi
>>
>> I am currently refactoring some third party resource class which is 
>> using Jelly and I would like to use the resource itself within the 
>> Jelly files, so I set within the resource
>>
>> jellyContext.setVariable("resource", this);
>>
>> and the use it within the Jelly as follows
>>
>> <p>${resource.getFoo()}</p>
>>
>> but somehow it does nothing, whereas the method getFoo() exists and 
>> compiles correctly.
>>
>> Any idea what might be wrong?
>
>
> It should work. Check if you don't have any syntactic mistakes in the 
> Jelly.


ok, will check again

>
> By the way. I always thought that exposing the "resource" to the Jelly 
> is not very nice. The jelly should only be concerned with what is 
> intended for it. As a template it should only know about the model (of 
> the view) because it is supposed to be used for rendering.


I guess it depends on what the Jelly is really used for

>
> When you start having ${resource.getFoo()}, ${resource.setFoo()} etc. 
> then the template becomes kind of an active entity, a controller. 
> Hence the same story as with JSP, where you mix view and controller.

I guess this depends on the discipline of the developer how this is 
"access" is used.

But I generally agree that one clearly seperates the controller from the 
view and not use Jelly as controller (not just because debugging of 
Jelly is hard)

Cheers

Michael

>
> Evaldas
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner at wyona.com, michi at apache.org
+41 44 272 91 61



More information about the Yanel-development mailing list