I am wondering if it's possible to have an if/else with Apache Tiles 2 (or JSTL that references a Tiles attribute, that would work to). Basically, I want this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<div>
<!-- Some stuff here -->
</div>
<tiles:if condition="showSecondDiv == 'true'">
<div>
<!-- Some second stuff here -->
</div>
</tiles:if>
There is <put-attribute name="showSecondDiv" value="true" type="string" />
in the Tiles XML. The motivation is that I want to reuse this JSP in a number of places, some that want to show both divs, others that only want to show one.
USING JSTL
example:
<c:if test="${!empty tilesAdditionalTitle}">
<fmt:param value="${requestScope[tilesAdditionalTitle]}" />
</c:if>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With