struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: ActionErrors.GLOBAL_ERROR
Date Sun, 02 Mar 2003 19:27:33 GMT
return (errors == null) ? false : true is redundant.

return (errors != null) is much simpler.

David


>From: Mohan Radhakrishnan <MohanR@hclcomnet.co.in>
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
>Subject: ActionErrors.GLOBAL_ERROR
>Date: Sun, 2 Mar 2003 21:29:48 +0530
>
>Hi,
>
>        I want to show the ActionErrors.GLOBAL_ERROR only if other errors
>like the following are not present.
>
>		    errors.add("key", new ActionError("information"));
>		    saveErrors( request, errors );
>
>Now I am using code like this that occasionally fails
>
>	protected boolean isErrorsPresent( HttpServletRequest request ){
>         ActionErrors errors = ( ActionErrors )request.
>			                             getAttribute(
>Action.ERROR_KEY );
>     return (errors == null) ? false : true;
>     }
>
>  What am I doing wrong ?
>
>Thanks,
>Mohan
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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


Mime
View raw message