You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arron Bates <ar...@pacific.net.au> on 2002/03/19 08:19:14 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Displaying recursively defined bean...

Posted by Sandeep Takhar <sa...@yahoo.com>.
does this work with struts 1.0?

thanks,

Sandeep
--- Arron Bates <ar...@pacific.net.au> wrote:
> 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:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards�
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>