Nested recursion does not recurse!

2003-06-17 Thread Chris Hatton
Hi, everyone,

Am I crazy?  I have been trying to get recursion to work using Arron's 
examples at keyboardmonkey and it absolutely will not recurse.  It just 
repeats the very first element.

Here's what I get displayed in my HTML results:
--
USA - productTree
ALABAMA - productTree.treeNodes[0]
ALABAMA - productTree.treeNodes[0]
ALABAMA - productTree.treeNodes[0]
ALABAMA - productTree.treeNodes[0]
--
Why is the same nested level repeated over and over?  Note: my Form class 
returns Object arrays (i.e. TreeNode[] getTreeNodes()).

Here's productNode.jsp:

--
%@ taglib uri=/WEB-INF/tld/struts-nested.tld prefix=nested %
nested:root
 	nested:write property=label / - nested:writeNesting/br 	
	nested:equal property=isExpanded value=true 		nested:iterate 
id=node property=treeNodes 			jsp:include page=productNode.jsp / 
		/nested:iterate 	/nested:equal
  /nested:root
--

And the relevant code from product.jsp:
--
nested:form action=submitJob.do method=POST
.
!-- Begin Product Tree --
nested:nest property=productTree
jsp:include page=../product/productNode.jsp/
/nested:nest
!-- End Product Tree --

/nested:form
--
I should note that I set isExpanded (i.e. showChildren) to true for the 
very top-level element.  I do have other (non-nested) Struts tags included 
in this page outside the ProductTree code.

I'm on Tomcat 4.1.18, RedHat 8.0, Struts 1.1 rc2, jdk 1.3.1_07.

Thanks!
Chris Hatton
Tobin International


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Nested recursion does not recurse!

2003-06-17 Thread Sandeep Takhar
Are you sure you want to include a page that has a
form in it?

nested:form, nested:nest and nested:iterate all start
a new root element that nested will use.

Whenever you do a jsp:include always do a 

nested:root

at the beginning if you are using nested tags.

sandeep
--- Chris Hatton [EMAIL PROTECTED] wrote:
 Hi, everyone,
 
 Am I crazy?  I have been trying to get recursion to
 work using Arron's 
 examples at keyboardmonkey and it absolutely will
 not recurse.  It just 
 repeats the very first element.
 
 Here's what I get displayed in my HTML results:
 --
 USA - productTree
 ALABAMA - productTree.treeNodes[0]
 ALABAMA - productTree.treeNodes[0]
 ALABAMA - productTree.treeNodes[0]
 ALABAMA - productTree.treeNodes[0]
 --
 
 Why is the same nested level repeated over and over?
  Note: my Form class 
 returns Object arrays (i.e. TreeNode[]
 getTreeNodes()).
 
 Here's productNode.jsp:
 
 --
 %@ taglib uri=/WEB-INF/tld/struts-nested.tld
 prefix=nested %
 
 nested:root
   nested:write property=label / -
 nested:writeNesting/br
   nested:equal property=isExpanded value=true   
 nested:iterate 
 id=node property=treeNodes   jsp:include
 page=productNode.jsp / 
   /nested:iterate   /nested:equal
/nested:root
 --
 
 
 And the relevant code from product.jsp:
 --
 nested:form action=submitJob.do method=POST
 .
   !-- Begin Product Tree --
   nested:nest property=productTree
   jsp:include page=../product/productNode.jsp/
   /nested:nest
   !-- End Product Tree --
 
 /nested:form
 --
 
 I should note that I set isExpanded (i.e.
 showChildren) to true for the 
 very top-level element.  I do have other
 (non-nested) Struts tags included 
 in this page outside the ProductTree code.
 
 I'm on Tomcat 4.1.18, RedHat 8.0, Struts 1.1 rc2,
 jdk 1.3.1_07.
 
 Thanks!
   Chris Hatton
   Tobin International
 
 
 
 -- 
 Using M2, Opera's revolutionary e-mail client:
 http://www.opera.com/m2/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Nested recursion does not recurse!

2003-06-17 Thread Arron Bates
All the markup seems fine.

This is very indicative of the older Struts on the newer tomcat. Double check
the version of Struts. 4.1.x was broken with recursion and such things, but
it's fixed for RC2. As a last resort, try this jar...

keyboardmonkey.com/downloads/km-nested-v2.03.jar

...throw it into the WEB-INF/lib directory. It has just the new nested tags,
should show if it's the tag version being out of whack.


Sandeep:
The new version of the tags above, doesn't need a nested:root for included
pages. Now all the tags now use the request object to hold their references,
all the nested tags just look for that rather than look at the current JSP's
tag layout. It just means that as long as the nested structure is started
(nested:form, nested:root, any nested parent tag), any include file can just
mark up child tags like normal and it should work.

I probably wouldn't have done this on purpose, but using the request object
use was the only way I could get the new tomcat working for some reason.


Arron.



 Are you sure you want to include a page that has a
 form in it?
 
 nested:form, nested:nest and nested:iterate all start
 a new root element that nested will use.
 
 Whenever you do a jsp:include always do a 
 
 nested:root
 
 at the beginning if you are using nested tags.
 
 sandeep
 --- Chris Hatton [EMAIL PROTECTED] wrote:
  Hi, everyone,
  
  Am I crazy?  I have been trying to get recursion to
  work using Arron's 
  examples at keyboardmonkey and it absolutely will
  not recurse.  It just 
  repeats the very first element.
  
  Here's what I get displayed in my HTML results:
  --
  USA - productTree
  ALABAMA - productTree.treeNodes[0]
  ALABAMA - productTree.treeNodes[0]
  ALABAMA - productTree.treeNodes[0]
  ALABAMA - productTree.treeNodes[0]
  --
  
  Why is the same nested level repeated over and over?
   Note: my Form class 
  returns Object arrays (i.e. TreeNode[]
  getTreeNodes()).
  
  Here's productNode.jsp:
  
  --
  %@ taglib uri=/WEB-INF/tld/struts-nested.tld
  prefix=nested %
  
  nested:root
  nested:write property=label / -
  nested:writeNesting/br  
  nested:equal property=isExpanded value=true   
  nested:iterate 
  id=node property=treeNodes jsp:include
  page=productNode.jsp / 
  /nested:iterate   /nested:equal
 /nested:root
  --
  
  
  And the relevant code from product.jsp:
  --
  nested:form action=submitJob.do method=POST
  .
  !-- Begin Product Tree --
  nested:nest property=productTree
  jsp:include page=../product/productNode.jsp/
  /nested:nest
  !-- End Product Tree --
  
  /nested:form
  --
  
  I should note that I set isExpanded (i.e.
  showChildren) to true for the 
  very top-level element.  I do have other
  (non-nested) Struts tags included 
  in this page outside the ProductTree code.
  
  I'm on Tomcat 4.1.18, RedHat 8.0, Struts 1.1 rc2,
  jdk 1.3.1_07.
  
  Thanks!
  Chris Hatton
  Tobin International
  
  
  
  -- 
  Using M2, Opera's revolutionary e-mail client:
  http://www.opera.com/m2/
  
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]