struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Dynamic Messages possible with bean:message tag?
Date Wed, 28 Aug 2002 23:36:57 GMT


On Wed, 28 Aug 2002, Mark Silva wrote:

> Date: Wed, 28 Aug 2002 16:14:51 -0700
> From: Mark Silva <msilva@authenex.com>
> Reply-To: Struts Users Mailing List <struts-user@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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message