Using a jsp fmt tag in another tag

java, jsp

Solution

Use an intermediate variable to store the result like this (code not tested)

<fmt:message key="somekey" var="formattedvarname" />
<local:roundedBox boxTitle="${formattedvarname}">
content
</roundedBox>

Problem

I'd like to be able to include the return value of a fmt tag in another tag: ``` <local:roundedBox boxTitle="<fmt:message key="somekey"/>"> content </roundedBox> ``` I've run into this problem multiple times and it just seems like a stupid limitation of jsp. Is there a simple way around this?

Original source