Monday, July 18, 2011

JSTL Gotcha

Why doesn’t this work?

<%@ taglib uri="" prefix="stripes" %>
<%@ taglib uri="" prefix="security" %>
<%@ taglib uri="" prefix="stripes-extension" %>
<%@ taglib uri="" prefix="c" %>
<%@ taglib uri="" prefix="fmt" %>
<%@ taglib uri="" prefix="fn" %>

<c:set var="a" value="A"></c:set>
<c:set var="b" value="B"></c:set>
<c:set var="c" value="C"></c:set>

<c:if test="${a=='A' }">
a= A,
<c:if test="${b=='B' } ">
<c:if test="${c=='C' }">

The answer is the space in the test B jstl tag.

Another few hours of my life wasted...
Also another time waster... Beware of <div id=”myDiv” class=”myDiv” />

Firefox didn’t like the autoclose tag. I needed to explicitly add a </div>

No comments: