You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/07/08 06:17:16 UTC

Re: Dynamic label


On Tue, 26 Jun 2001, Pal, Gaurav wrote:

> Hi,
> 
> I am trying to create a dynamic label HTML form through the bean:message
> tag. What I want to do is as follows:
> 
> <bean:message key="<%= myBean.getLabel() %>.label.header" />
> 

You got a compile error because this is not legal JSP syntax.  If you are
going to use a runtime expression, it must be the *entire* attribute
value.  Try this instead:

  <bean:message key="<%= myBean.getLabel() + ".label.header" %>"/>

> It gives a compilation error that the key string is unenclosed, anybody have
> any ideas how to do this?
> 
> Thanks in advance for your help,
> Gaurav
> 

Craig