Yes, but I do not want to use a scriptlet. This value needs to be
available outside of using a scriptlet (without having to write a JSP
function to return that value).

Which comes back to what Joe suggested.

Unfortunately it looks like I'll be taking the cumbersome approach.

Chris
On 6/7/06, Samere, Adam J <[EMAIL PROTECTED]> 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.

-----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


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

Reply via email to