Spring message in JSTL Tag

In case for reference,

<c:choose>
  <c:when test="${serviceVO.id eq 0}"> 
     <spring:message code="label.service.createservice" var="buttonName"/> 
  </c:when> 
  <c:otherwise>
    <spring:message code="label.updateservice" var="buttonName"/> 
  </c:otherwise>
</c:choose>

<c:out value="${buttonName}"> //Prints the desired value...

The spring message tag, just as fmt:message, has a var attribute that can be used to store the message instead of displaying it.

It always helps to read the documentation.

Also, your wrong message probably comes from forgettin to declare the spring taglib at the top of your JSP.


I think what you wanna do is.

<spring:message code='lman.ilr.closeItemDetail' var="closeMessage"/>

Then

<dsg:sidePanelContent closePanelText="${closeMessage}">