Re: JSP still relevant
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---910079544-1634634566-1246058145=:7242
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
On Fri, 26 Jun 2009, David wrote:
On Jun 26, 12:23?pm, Tom Anderson <t...@urchin.earth.li> wrote:
<c:set var="onFirstPage" value="${pageIndex == 0}"/>
<c:choose>
? <c:when test="${onFirstPage}">
? ?You are on page <c:out value="${pageIndex + 1}"/>
? </c:when>
? <c:otherwise>
? ?You are on the first page
? </c:otherwise>
</c:choose>
I absolutely hate the syntax they used for this- choose, when,
otherwise! In a vacuum it's fine, but the terms used are so very
unrelated to anything else you use in Java. Best I can tell, the only
reason they used that syntax was to show they were breaking away!
why not
<c:ifelseif>
<c:if ...>show stuff</c:if>
<c:if ...>show something else</c:if>
<c:else ...>show the default</c:else>
</c:ifelseif>
The 'if' task in ant (actually ant-contrib - and don't get me started on
how much i hate ant) looks like:
<if>
<equals arg1="${pageIndex}" arg2="0"/>
<then>
whatever
</then>
<else>
whatever else
</else>
</if>
Which is weird in its own way (else goes inside if?), but i think is
better than what JSTL does.
tom
--
Heinlein has done more to harm SF than has any other writer, I think. --
PKD
---910079544-1634634566-1246058145=:7242--