At 4:37 PM -0400 6/7/06, Samere, Adam J wrote:
How about just:

<logic:messagesPresent message="true"
property="<%= ActionMessages.GLOBAL_MESSAGE %>">
.....
</logic:messagesPresent>

You don't want to tie your code to the actual key since that is an
implementation detail, that's what the public constant is for.

Another rationale for making the tags smart enough to handle that for you, while keeping scriptlet expressions out of your page!

Joe



-----Original Message-----
From: Joe Germuska [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 07, 2006 3:55 PM
To: Chris Cheshire; Struts Users Mailing List
Subject: Re: displaying ActionMessages.GLOBAL_MESSAGE messages only

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.

Joe

--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com
"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
        -- Robert Moog

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


-----------------------------------------
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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


--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com
"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
        -- Robert Moog

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

Reply via email to