You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Loschen <Ch...@Siebel.com> on 2005/08/13 21:07:58 UTC

Displaying errors for all except one key

Hi all,

The app I'm working on (using Struts 1.1) has handled errors pretty
simply: they all used to display in one place. However, now we want to
display some errors separately. We've already set up the errors we want
to display separately with their own key, like this:

        	errors.add(RIGHT_PANE_THRESHOLD_PROPERTY, new
ActionError(RIHierarchyMessages.RIGHT_PANE_THRESHOLD_EXCEEDED));

And then we set up the main error display JSP like this:

<%-- Display Error Messages if the showErrors parameter is true --%>
<logic:equal name="showErrors" value="true">
	<%String global_key=ActionErrors.GLOBAL_ERROR; %>
	<logic:messagesPresent message="false"
property="<%=global_key%>">
		<div class="errorMsg"><ul>
			<html:messages id="message" message="false"
property="<%=global_key%>"> 
				<li><bean:write name="message"/></li>
			</html:messages>
		</ul></div>
	</logic:messagesPresent>
</logic:equal>

That works fine as long as the errors are coming through with the
GLOBAL_ERROR key. The special error with its special key doesn't get
displayed, and gets displayed where we want it instead. However, we're
now discovering that we're not getting other errors, specifically the
errors thrown by the Validator. I'm guessing that these are not being
sent with the GLOBAL_ERROR key but some other key, though my Googling
and other research hasn't yet told me which one.

I'd be curious to know what key the validator errors are sent with, but
more importantly, I need to figure out how to display some keys but not
others in my main error display. My best choice would be to do something
like "display any errors with properties that are NOT ..." At the
moment, there is just one property which we need to exclude, but that
could possibly grow down the road.

Does anyone have any ideas? Thank you!

Chris Loschen


_______________
Siebel
IT'S ALL ABOUT THE CUSTOMER
Visit www.siebel.com

This e-mail message is for the sole use of the intended recipient(s) and contains confidential and/or privileged information belonging to Siebel Systems, Inc. or its customers or partners. Any unauthorized review, use, copying, disclosure or distribution of this message is strictly prohibited. If you are not an intended recipient of this message, please contact the sender by reply e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org