You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Hall <sh...@assisted.com> on 2002/10/25 20:28:19 UTC

nested:iterate recursion inverts tree

I'm new to using nested tags.  I've worked through the keyboard monkey
tutorial and started experimenting with the nested tags on my own.  I've run
into something that perplexes me.  My tree's are inverted when I use
recursive calls to a jsp that iterates over the nested nodes. i.e.:

---------------------
nested.jsp
...
<nested:root>
  <nested:iterate property="nodes">
    <nested:write property="nodeName"/><br>
     <jsp:include page="nested.jsp" />
  </nested:iterate>
</nested:root>
...
---------------------

I would expect the page to display:

root
  node1
    node1.1
    node1.2
  node2
   node2.1
     node2.1.1
etc...

The monkey tree tutorial and my experimentation displays the tree as:

     node2.1.1
   node2.1
  node2
    node1.2
    node1.1
  node1
root

Is this the expected behavior of the nested iterate tag when recursively
displaying a Composite (tree)?  Am I using the tags incorrectly?  How do I
get the JSP to display the tree "root down"?  Is there something in my
environment that is causing the JSP iteration to run before any printing to
the outputstream is executed?  Do I have to "hard code" all the iteration
levels into my JSP to get the tree to display "root down"?

Environment:
Struts 1.1 b2
Weblogic 5.1 sp11 (don't ask :-/ )
jdk 1.3.1
sdk 1.2.1

Thanks for any light you can shed on the subject.

Steve Hall
Programmer Analyst
Alterra Healthcare
(414) 918 5636
shall@assisted.com


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


Re: nested:iterate recursion inverts tree

Posted by Arron Bates <st...@keyboardmonkey.com>.
So you ran the directory tree war (the end of the monkey-tree example),
and the directory tree came out upside down?...

If it did, I'd have to say it's how your container is evaluating the
JSP. I would think that it's compiling all the objects and evaluating
their output. But in doing so, it's committing their content to the
response stream in the wrong order.

The directory tutorial's been tried in many containers and comes out
sweet. What JSP spec version is that version of WebLogic?... It's
probably amazing that it can compile the true recursion at all. Most
containers have to be on the later JSP spec.


Arron.



On Sat, 2002-10-26 at 04:28, Steve Hall wrote:
> I'm new to using nested tags.  I've worked through the keyboard monkey
> tutorial and started experimenting with the nested tags on my own.  I've run
> into something that perplexes me.  My tree's are inverted when I use
> recursive calls to a jsp that iterates over the nested nodes. i.e.:
> 
> ---------------------
> nested.jsp
> ...
> <nested:root>
>   <nested:iterate property="nodes">
>     <nested:write property="nodeName"/><br>
>      <jsp:include page="nested.jsp" />
>   </nested:iterate>
> </nested:root>
> ...
> ---------------------
> 
> I would expect the page to display:
> 
> root
>   node1
>     node1.1
>     node1.2
>   node2
>    node2.1
>      node2.1.1
> etc...
> 
> The monkey tree tutorial and my experimentation displays the tree as:
> 
>      node2.1.1
>    node2.1
>   node2
>     node1.2
>     node1.1
>   node1
> root
> 
> Is this the expected behavior of the nested iterate tag when recursively
> displaying a Composite (tree)?  Am I using the tags incorrectly?  How do I
> get the JSP to display the tree "root down"?  Is there something in my
> environment that is causing the JSP iteration to run before any printing to
> the outputstream is executed?  Do I have to "hard code" all the iteration
> levels into my JSP to get the tree to display "root down"?
> 
> Environment:
> Struts 1.1 b2
> Weblogic 5.1 sp11 (don't ask :-/ )
> jdk 1.3.1
> sdk 1.2.1
> 
> Thanks for any light you can shed on the subject.
> 
> Steve Hall
> Programmer Analyst
> Alterra Healthcare
> (414) 918 5636
> shall@assisted.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>



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