The biggest benefit this has which the other tags cannot capitalize on, is that they can be used in a markup manner without too much regard as to how much code is in the JSP that started the run. The included JSP could be the fifth inclusion, 100 beans down, but as long as the definition of the current bean matches the tags it uses, it will work. And work for everything, form inputs or whatever.
The other tags and the explicit dot notation fashion, is limited to your knowledge of the entire data model and have to explicitly set it each time. Arron. Heath Chiavettone wrote: >This is a VERY useful feature. Thanks for caving in before the beating left >you unconscious!!! I couldn't use tiles and nested together very easily >without it! > >Thanks Arron! > >-----Original Message----- >From: Arron Bates [mailto:[EMAIL PROTECTED]] >Sent: Monday, March 18, 2002 11:19 PM >To: Struts Users Mailing List; Alex Paransky >Subject: Re: Displaying recursively defined bean... > >Alex, > >This is continuing a discussion we had a month ago (moreover, I had to >dig through my emails to find out who I was arguing with over it :)... > >With further deliberation on its implementation (and a couple more >people beating me for the feature), the nested taglibs are now using the >session object and the tag objects themselves, to temporarily store the >information needed to get dynamic includes working. >In short... you can use dynamic includes with nested tags! > >So this is a retraction of sorts. :) > >It's a retraction because the result, is indeed very cool. Now being >able to have true object style recursion in the markup to draw a tree >that can have all the form inputs you can eat. Oh, it is a beautiful >sight :) > >I already have a working tree in an app from this system. I'm working on >a tutorial at the moment to show it off and define the details. But for >a brief going over... here was my test. > >For the first page... > > <html:form action="/action-tutorial.do"> > <nested:nest property="this/"> > <jsp:include page="includer.jsp" /> > </nested:nest> > </html:form> > >... and the included JSP ... > > <nested:root> > Test: <nested:write property="monkeyName" /> > </nested:root> > >Only detail being that the included page has to be started off with an >empty <nested:root> tag (because all the child tags need a parent to get >their details from). Simple enough. > >You can get the jar update from my site, or the Struts nightly build. >http://www.keyboardmonkey.com/struts > >Arron. > >Alex Paransky wrote: > >>Well, that's the problem, I don't have a finite number of levels. I am >>trying to display a message thread, so I do not know how deep the message >>thread will go. Today it's 12 levels, tomorrow, I might have a problem in >>my app because some thread has 24 replies one after the other making 24 >>levels deep. >> >>With a dynamic include, I get a new pageContext every time, which means I >>can use that context like a "stack". With static include, the page get's >>compiled into my code before execution, so as you said, I will be hard >>coding the page to N number of levels say 12. >> >>I really don't want to physically mark up 12 levels, they are all the same. >>I also, don't want to write some recursive function in my .jsp page. I >>just need to arbitrarily descend down to any number of levels and render >> >the > >>entire tree. >> >>I don't think this can be done with static includes, they must be dynamic. >> >>-AP_ >> > > >-- >To unsubscribe, e-mail: ><mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> > > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>