This was quite an elegant solution. Thanks!

By the way I read about loops in your book "JSTL in Action" just
before posting this question, what a coincidence :)

cheers,
Sakke 

-----Original Message-----
From: Shawn Bayern [mailto:[EMAIL PROTECTED]]
Sent: 14. helmikuuta 2003 16:31
To: Tag Libraries Users List
Subject: **SPAM** Re: Looping a tree-structure of objects of unknown
depth


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to