tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: Looping a tree-structure of objects of unknown depth
Date Fri, 14 Feb 2003 14:31:14 GMT
Of course (and as not shown in my quick back-of-the-envelope code sample),
you've got to pass the "current" directory back to the page, either as a
parameter or by using <c:set>.  (If you use <c:set>, you have to restore
the "old" directory after the call.)

So it does work, but subtleties make me think that as cute as solutions
like this are, they're better done in Java.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern

On Fri, 14 Feb 2003, Shawn Bayern wrote:

>   printDirectory.jsp
>   ----------------------
>   <c:forEach value="${requestScope.currentDir}" var="f">
>     <c:choose>
>       <c:when test="${f.file}">
>         <c:out value="${f.name}" /> <br />
>       </c:when>
>       <c:when test="${f.directory}">
>         <table>
>           <tr>
>             <td>
> 	      <b><c:out value="${f.name}" /></b> <br />
>               <jsp:include page="printDirectory.jsp" />
>             </td>
>           </tr>
>         </table>
>       </c:when>
>     </c:choose>
>   </c:forEach>
> 
> Cute, huh? :-)
> 
> 


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


Mime
View raw message