You do this with displaytag in the same way as without it. Just calculate the desired block in the servlet / action manager for your JSP and store this device in some bean in the request. Then select this bean in JSP:
<display:column>${theBeanStoredInTheRequest.unit}</display:column>
Or compute it in the JSP itself using JSTL, but it is more verbose:
<display:column> <c:choose> <c:when test="${sessionScope.unit == 1}">AAA</c:when> <c:when test="${sessionScope.unit == 2}">BBB</c:when> <c:when test="${sessionScope.unit == 3}">CCC</c:when> <c:otherwise>undefined</c:otherwise> </c:choose> </display:column>
source share