On Tue, 5 Jun 2001, 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
> 

You can subclass ServletException with your own exception classes, but I
would recommend against this approach.  What it will cause is that your
user will see an ugly stack trace.  It would be better to forward control
to some error handling action (or page) that deals with this kind of a
problem more gracefully.

Craig


Reply via email to