You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Silva <ms...@authenex.com> on 2002/08/29 01:14:51 UTC

Dynamic Messages possible with bean:message tag?

Hello,

I am trying to use the ApplicationResources file to display titles, messages, etc.  I would like to create these messages dynamically based on a request parameter.

For example
<bean:message key="AuthenticationReport.title"/>

I would lie to dynamically change the "AuthenticationReport"  based on a request variable.  This way I can use a single page for all reports, and all international messages too!  Is this possible?  Otherwise I may have to create a different page for each report.  Seems like a very useful feature.

Thanks,
Mark

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Dynamic Messages possible with bean:message tag?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 28 Aug 2002, Mark Silva wrote:

> Date: Wed, 28 Aug 2002 16:14:51 -0700
> From: Mark Silva <ms...@authenex.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Dynamic Messages possible with bean:message tag?
>
> Hello,
>
> I am trying to use the ApplicationResources file to display titles,
> messages, etc.  I would like to create these messages dynamically based
> on a request parameter.
>
> For example
> <bean:message key="AuthenticationReport.title"/>
>
> I would lie to dynamically change the "AuthenticationReport"  based on a
> request variable.  This way I can use a single page for all reports, and
> all international messages too!  Is this possible?  Otherwise I may have
> to create a different page for each report.  Seems like a very useful
> feature.
>

Also very easy to do already - use a runtime expression :-)

  <bean:message key='<%= request.getParameter("report") + ".title" %>'/>

> Thanks,
> Mark

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>