Re: Access the Environment "localContextStack" ....
Tom Fennelly <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Daniel Dekany wrote: >> Hi guys. >> >> From inside the execute method of a TemplateDirectiveModel >> implementation, is it possible to gain access to the local context stack >> on the passed Environment instance (freemarker 2.3.11)? >> >> I have a template like this... >> >> <#list bean.aaas as aaa> >> <@writeBean aaa /> >> </#list> >> >> Inside the <@writeBeans> Directive impl, I can see (with a debugger) >> that it has the data I want (the aaa loop instance). Problem is... the >> access method is protected :( >> > > You mean the "aaa" loop variable? That should be in a "param" > parameter of TemplateDirectiveModel.execute(..., Map params, ...). > However, TemplateDirectiveModel parameters must be named, and yours is > positional. Didn't it give an error? > Ah OK... thanks Daniel.... I did <@writeBean bean="aaa" /> and looked up the bean inside the TemplateDirectiveModel impl.... all works good now.... thanks!!! I didn't get an error. What's the right way of resolving an object graph type reference e.g. <@writeBean bean="order.customer" /> ? T. ------------------------------------------------------------------------------