You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/07/29 15:25:02 UTC

nested taglib & tomcat 4.1.8 problems

Subject: nested taglib & tomcat 4.1.8 problems
From: Torgeir Veimo <to...@pobox.com>
 ===
A recursive tree that works nicely with tomcat 4.0.2, gives me problems 
with tomcat 4.1.8;

tree in 4.0.2;


   users
     pub
     arne
       nif200078
     nif200078
   pub
     calendar
     news
   images
   media
   news
   discussions
     rambling
   calendar
   groups
     admin
     group23

tree in 4.1.8;

desk
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub
   users
     pub
     pub
     pub

The code is very similar to the keyboardmonkey.com nested taglib example 
code. The number of children of the root node is correct, and it seems 
that the iterate or root tag doesn't work as expected. The number of 
children of the second level is incorrect except for the first node.

Anyone seen similar stuff?

sectiontree.jsp;

<%@page contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>

<html>
<head>
     <html:base />
     <link rel=stylesheet type="text/css" href="../../style/default.css">
</head>
<body>

<nested:form action="/sectiontree">
<table border="0" cellpadding="0" cellspacing="0">
     <tr><td class="heading" colspan="2"><bean:message 
key="desk"/></td></tr>
     <nested:nest property="tree">
         <tiles:insert page="treenode.jsp" flush="false"/>
         <%--<jsp:include page="treenode.jsp" flush="true" />--%>
     </nested:nest>
</table>
</nested:form>

</body>
</html>

treenode.jsp;

<%@page contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>

<%--<nested:root>
   <img src="../images/spacer.gif" width="<nested:write 
property='nodeIndent'/>" height="1">
   <nested:write property="name" /><br>

   <nested:iterate property="children">
     <jsp:include page="treenode.jsp" flush="false"/>
   </nested:iterate>

</nested:root>--%>

<nested:root>
     <nested:define id="url" property="path"/>
     <tr class="plain"><td valign="middle" width="60%">
         <img src="../images/spacer.gif" width="<nested:write 
property='nodeIndent'/>" height="1">
         <html:img page="/images/folder.png" alt="" border="0"/>
         <html:link page='<%= "/pages" + (String)url%>' target="_new">
         <nested:write property="name"/><br>
         </html:link>
     </td><td width="40%" valign="middle">
         [<html:link page='<%= "/section.do?path=" + (String)url%>'>
         <bean:message key="edit"/>
         </html:link>]
     </td><tr>
     <nested:iterate property="children">
         <tiles:insert page="treenode.jsp" flush="false"/>
         <%--<jsp:include page="treenode.jsp" flush="true"/>--%>
     </nested:iterate>
</nested:root>

-- 
-Torgeir


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