Re: WM.org down? - somebody pls remind me about recursion
Keats Kirsch <[email protected]> Fri, 29 Jul 2005 18:12:39 -0400
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Yes the #eval/#templet mechanism is the way to go. You get a new context for each iteration with a reference to the original context. There's an example in the unit tests you can look at. Keats Marc Palmer wrote: >Hi guys, > >I can't reach webmacro.org here - it's resolving but timing out. Eric? > >Anyway, can somebody give me a bit of clarity on WM recursion - I've >forgotten the details. > >Basically I am recursively including a template to render a tree. However >the included template is of course trashing the variables in the "outer" >context. > >Is the solution to this to use #eval or #templet? Something that is part >of WM core is preferred - whereby I can pass in certain values but the >included template fragment gets its own Context. > >I'm using my WM JSP taglib code and it's working well "in anger" here >(literally - the JSP pissed me off so much and caused so much ugliness to >do this recursive rendering, so now we have a JSP/WM hybrid). > >I can "push" the sensitive variables to temp vars before the include and >"pop" them off after but that is ugly indeed. > >Cheers > > > > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click