The pattern is to create a local instance of  ActionErrors. Then add to 
it if any errors occur. At then end, look to see if it is empty or not 
(errors.empty()). If it is not empty, then somebody posted soemthing, 
and you should call saveErrors() and branch to your error page. 
Otherwise, you can save your own objects and branch to success.

-Ted.

Billy Ng wrote:

> thanks!  I thought there was a method or a way to see the ActionError is not
> null or its length larger than 0 in the Action before the view with error
> displayed
> 
> Billy Ng
> 
> ----- Original Message -----
> From: "John Yu" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 04, 2002 6:39 PM
> Subject: Re: Detect errors in Action
> 
> 
> 
>>Billy,
>>
>>What do you mean by "detecting any errors"? Does this work for you:
>>
>>   try {
>>     ...
>>   } catch(..) {
>>     // set things into the request
>>     // forward to the error page
>>   }
>>
>>
>>At 07:37 am 05-09-2002, you wrote:
>>
>>>Hi folks,
>>>
>>>Would anybody tell me if I can detect any errors occur in the Action?  It
>>>is because i have some objects created in the Action.  If there is error,
>>>I need to set the objects into the request becuase the view displayed.
>>>
>>>Thanks!
>>>
>>>Billy Ng
>>>
>>--
>>John Yu                       Scioworks Technologies
>>e: [EMAIL PROTECTED]         w: +(65) 873 5989
>>w: http://www.scioworks.com   m: +(65) 9782 9610
>>
>>Scioworks Camino - "Don't develop Struts Apps without it!"
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
> <mailto:[EMAIL PROTECTED]>
> 
>>For additional commands, e-mail:
>>
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 


-- 
Ted Husted, Husted dot Com, Fairport NY US
co-author, Java Web Development with Struts
Order it today:
<http://husted.com/struts/book.html>


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

Reply via email to