tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Makoto Nagata <mnag...@micronova.com>
Subject Re: Recursion in JSP
Date Fri, 06 Aug 2004 04:09:55 GMT
Hi Andrew,

If what you need is to call JSPs recursively, MicroNova YUZU tag library
(http://sourceforge.net/projects/micronova-yuzu) supports recursion
passing arbitrary (non-string) objects using <m:call> and <m:param> tags
like this:

<m:param var="input"/>

<tag:tree>
   <c:forEach var="child" items="${input.root.children}">
     <m:call path="dfs.jsp">
       <m:set property="root" value="${child}"/>
     </m:call>
   </c:forEach>
</tag:tree>

Hope this helps.

Best Regards,  Makoto Nagata


Andrew Janian wrote:
> Does anyone know if I am able to use recursion to traverse a tree but then to use a tag
inside the recursive method?  If that was unclear, I want to know if I can do this:
> 
> <%!
> void dfs(Node root){
> %>
> 	<tag:tree>
> <%!
> 	Vector children = root.getChildren();
> 	for(int i=0; i<children.size(); i++){
> 		dfs((Node)(children.elementAt(i)));
> 	}
> %>
> 	</tag:tree>
> <%!
> }
> %>
> 
> Thanks,
> 
> Andrew Janian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message