Archive

Archive for June, 2013

Little tip for mixing JSTL and Tiles

June 19, 2013 1 comment

If you want to use a value set in Tiles with JSTL in a JSP page, here’s how you do it:

<tiles:useAttribute name="anAttributeYouSetInGeneralXML"  id="theVarToUseInJSTL" classname="java.lang.Boolean"/>

<c:choose>

<c:when test="${theVarToUseInJSTL==true}">

This is shown when anAttributeYouSetInGeneralXML is set to True

</c:when>

</c:choose>

and in the definition file:

<put-attribute name="anAttributeYouSetInGeneralXML" value="true" cascade="true"/>
Advertisements
Categories: R&D Tags: , ,