I am trying to infer a key in a localized message in a jsp template as follows:
<c:set var="logo-tooltip-title"> <fmt:message key="logo.tooltip.title"/> </c:set> <c:out value="${logo-tooltip-title}"/>
In my messages.properties file, the following:
logo.tooltip.title=Test
Does anyone know what I'm doing wrong here? Why does it return 0 instead of Test?
My goal is to display this message as the title of the following link:
<a class="logo" href="/site/" title="${logo-tooltip-title}"> <img src="<hst:link path="/img/logo.png"/>" alt="logo" class="headlogo" width="80" height="100" /> </a>
Any thoughts on the best approach to this?
Thanks!
EDIT:
yes I set the context parameter to web.xml:
<context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>messages</param-value> </context-param>
resource
Update:
It works:
<fmt:message key="logo.tooltip.title" var="tooltip"/> <c:out value="${tooltip}"/>
source share