"jsp:attribute" in "c:if" to add "class" on "li"
843840Jul 8 2008 — edited Jul 8 2008Hi,
I want to add a "class" attribute to a "li" tag depending on a variable. I have this code :
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
...
<jsp:element name="li">
<c:if test="${param.appli == 'aze'}">
<jsp:attribute name="class">active</jsp:attribute>
</c:if>
<jsp:body>
...
</jsp:body>
</jsp:element>
This is one of my multiples tries.
the problem seems to be when "jsp:attribute" is in "c:if". Without "c:if", "jsp:attribute" work well. Inverse, alone, "c:if" with a test text work well.
Any idea ?
Thanks,
Xavier