Akrikos
Akrikos

Reputation: 3662

Using a jsp fmt tag in another tag

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?

Upvotes: 4

Views: 1237

Answers (1)

Simon Groenewolt
Simon Groenewolt

Reputation: 10665

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>

Upvotes: 7

Related Questions