Thanks for the idea.

----- Original Message ----- 
From: "John Raley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 5:01 PM
Subject: Re: throwing Exceptions from perform()


> Hi Jonathon,
> 
> Struts calls Action.perform from the ActionServlet.  Servlets are 
> allowed to throw only these two exceptions from their service() methods 
> - so you'll need a proprietary Servlet framework as well... :^)
> 
> In my app I have a base Action class with a final perform() method.  All 
> of my actions are subclasses of this base - they implement a different, 
> protected method called doPerform() that can throw any exception.  The 
> base perform() method calls doPerform(), catches exceptions and handles 
> them appropriately.  Would this design work for you?
> 
> 
> Jonathan wrote:
> 
> > I am seeing that I can only throw IOException and ServletException 
> > from my Action classes.  Now I was thinking about adding Exceptions to 
> > the Action class but that would make it proprietary.  I could add just 
> > Exception, but I dont want to change anything without good reason.  
> > Can you all telll me why I am limited to these two exceptions and what 
> > you all are doing about this.  The reason is that I have my own 
> > exceptions for my app, and will need to throw them sometimes within 
> > the perform method.
> >
> > Thanx
> >
> > Jonathan
> >
> 
> 
> 

Reply via email to