Re: Access the Environment "localContextStack" ....
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Monday, May 17, 2010, 6:04:34 PM, Tom Fennelly 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? > T. -- Best regards, Daniel Dekany ------------------------------------------------------------------------------