On 6/7/06, Joe Germuska <[EMAIL PROTECTED]> wrote:
At 12:47 PM -0700 6/7/06, Chris Cheshire wrote:
>In my actions I have messages stored in the session either under
>ActionMessages.GLOBAL_MESSAGE, or my own key (eg 'search').
>
>In my jsp I have a section to display the search specific messages.
><logic:messagesPresent message="true" property="search">
>....
></logic:messagesPresent>
>
>I also need to display the global messages at the top of the page,
>however this displays everything, including the search messages:
>
><logic:messagesPresent message="true">
>...
></logic:messagesPresent>
>
>What do I set for the property to ONLY display the messages keyed by
>ActionMessages.GLOBAL_MESSAGE?

technically, you would use

<logic:messagesPresent message="true"
property="org.apache.struts.action.GLOBAL_MESSAGE">
....
</logic:messagesPresent>

It has been observed that this is kind of cumbersome.  A nice
enhancement (that just about any willing volunteer could do, hint
hint :-) ) would be to enhance the logic:messagesPresent,
logic:messagesNotPresent, and html:messages and html:errors tags to
have another attribute, "global" which if it had the value"true"
would save you from needing to know that verbose property name.

AFAIK there is no actual processing related to
ActionMessages.GLOBAL_MESSAGE in Struts and it just means its a far
more cumbersome key to use than something simple like a property name
of "global" and IMO property="global" is not much different than
global="true". I also think adding another attribute just adds
confusion with global="true" being an alias for
property="org.apache.struts.action.GLOBAL_MESSAGE"


AFAIK there is no actual processing related to
ActionMessages.GLOBAL_MESSAGE in Struts and adding another attribute
just adds confusion with global="true" being an alias for
property="org.apache.struts.action.GLOBAL_MESSAGE". Better for people
to just use their own simpler property names to achieve the same thing
- for example property="global" works just as well?

Niall

Joe

--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to