Thanks again. Where is the spec? I tried what you gave me, slightly edited, as follows:
<c:forEach var="v" items="${categoryLineages}" varStatus="outerStatus"> <c:if test="${!outerStatus.first}"><br/></c:if> <c:forEach var="seriesCat" items="${v}" varStatus="status"> <c:if test="${!status.first}">/</c:if> <c:out value="${seriesCat.safeTitle}"/> </c:forEach> </c:forEach>
I get the following exception:
[ServletException in:/WEB-INF/tiles/content/misc/EditSeries.jsp] /WEB-INF/tiles/content/misc/EditSeries.jsp(21,0) According to TLD or attribute directive in tag file, attribute items does not accept any expressions' org.apache.jasper.JasperException: /WEB-INF/tiles/content/misc/EditSeries.jsp(21,0) According to TLD or attribute directive in tag file, attribute items does not accept any expressions at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83) at
Know what's wrong?
Robert Taylor wrote:
There are several good references on line for learning JSTL, but I have found the actual spec itself to be great.
I'm assuming you want something like <br>AAA/BBB/CCC<br>DDD/EEE/FFF etc...
<c:forEach var="v" items="${vectors}"> <br> <c:forEach var="seriesCat" items="${v}" varStatus="status"> <c:if test="${!status.first}">/</c:if> <c:out value="$(seriesCat}"/> </c:forEach> </c:forEach>
To avoid the first <br>, use the same logic as the inner loop:
<c:forEach var="v" items="${vectors}" varStatus="outerStatus"> <c:if test="${!outerStatus.first}"><br></c:if> <c:forEach var="seriesCat" items="${v}" varStatus="status"> <c:if test="${!status.first}">/</c:if> <c:out value="$(seriesCat}"/> </c:forEach> </c:forEach>
should produce something like:
AAA/BBB/CCC<br>DDD/EEE/FFF etc...
BTW, this code is untested, but it should work.
robert
-----Original Message----- From: Dean A. Hoover [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 8:01 PM To: [EMAIL PROTECTED] Subject: Re: inserting delimiters
Thanks Robert. It looks like I need to learn JSTL. Any suggestions? Also, the original problem I posted has changed a little. I am now stuffing a Vector of Vectors of SeriesCategory (my object). SeriesCategory has a getSafeTitle() method that gets an XML safe character string title for the category. This is a little like the problem I posted, except that the outer loop needs a <br/> delimiter and the inner loop needs the / delimiter. What might that look like?
Robert Taylor wrote:
One solution would be the following:
<c:forEach var="item" items="items" varStatus="status"> <c:if test="${!status.first}">/</c:if> <c:out value="$item"/> </c:forEach>
robert
-----Original Message----- From: Dean A. Hoover [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 8:02 AM To: [EMAIL PROTECTED] Subject: inserting delimiters
I have a Collection of Strings that I want to render with delimiters. Suppose The Strings are "AAA", "BBB", and "CCC". For example, I want to delimit the strings with /
So the insertion would look like this: AAA/BBB/CCC
How would you recommend I go about it? If I were doing this in Java instead of JSP I would treat the first pass through the loop as a special case. I'm not sure how to do this with the logic or JSTL tags.
Thanks. Dean Hoover
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]