struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manish Singla <Manish.Sin...@Sun.COM>
Subject Re: Accessing action error problem
Date Sat, 27 Sep 2003 17:31:18 GMT
a) Get ServletContext of Globals.ERROR_KEY.
b) Typecast to ActionErrors
c) Use     errors.get(property)
d) (c) wil return Iterator ......


Sgarlata Matt wrote:

> You can use the attached JSPs to display all the attributes in the request.
> Just look for the attribute that stores the errors.  In general when I was
> starting with Struts I found the attached JSPs very helpful because you can
> see the types of information Struts stores for you and where it is stored.
> Also, if you look at the Globals class the locations for many of these
> attributes are recorded there.  I just find it easier to look at the actual
> attributes in the request using the attached JSPs rather than hunting
> through the javadoc of the Globals class.
>
> Matt
> ----- Original Message -----
> From: "Pete Serafin" <pserafin@hcrnetwork.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Wednesday, July 02, 2003 1:32 PM
> Subject: Accessing action error problem
>
> > Im am trying to determine a way to find out if an ActionError exists in my
> request.  I create an error in my action class as follows:
> >
> > ActionErrors errors = new ActionErrors();
> > errors.add( "startDate",new
> ActionError("error.form.requiredField.startDate") );
> > saveErrors( request, errors );
> >
> > I can access the error using the <html:errors /> tag, but all I actuallt
> want to do is check that the startDate error is not null. How can I try to
> grab this object from the HttpServletRequest object?
> >
> > The whole point is to execute some logic that hides some html if an error
> exists.  Any suggestions?
> >
> > Pete Serafin
> > HealthCare Recruiters International
> >
>
>   ------------------------------------------------------------------------
>                 Name: debug.zip
>    debug.zip    Type: Zip Compressed Data (application/x-zip-compressed)
>             Encoding: base64
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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