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:35:18 UTC

Re: Global values as Tag parameters....How???


On Wed, 27 Jun 2001, Jonathan wrote:

> I am creating a custom Struts tag which needs to search for an object
> in a HashMap.  I want the 'key" for the object in the HashMap to be
> some agreed upon, pre-defined, final global value defined in a file
> available to the whole application.  How do I refer to this value in a
> Tag attribute?
> 
> eg.
> <html:userTargetedMessages messagesObjectKey="Globals.MESSAGES_OBJECT"/>
> 
> where "Globals.MESSAGES_OBJECT" is some static final variable in a file
> 

One approach that is fairly close to this would be a runtime expression:

<html:userTargetedMessages
     messagesObjectKey="<%= Globals.MESSAGES_OBJECT %>"/>

Craig