Re: setting variables from within a custom TemplateDirectiveModel
Grégory Joseph <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks ! I'll have to have a deeper look at the whole class, because your code snippet seems to be exactly what I was doing (except I was taking a shortcut to instanciate the TemplateModel) -g On Feb 26, 2010, at 21:17, Antonio Petrelli wrote: > 2010/2/26 Grégory Joseph <[email protected]>: >> Now, what I'd need is to push variables to be used by this body. > > Take a look at how Tiles-Freemarker integration works: > http://svn.eu.apache.org/repos/asf/tiles/framework/trunk/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/context/FreeMarkerUtil.java > > In other words: > > <snip> > Object obj; // Your object to put. > ... > TemplateModel model = env.getObjectWrapper().wrap(obj); > env.setVariable(name, model); > </snip> > > HTH > Antonio > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > FreeMarker-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freemarker-user ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev