From: "Scott Purcell" <[EMAIL PROTECTED]>
> I have created a site with a mysql database back-end, and full struts
front end. I have a filter to
> ensure the creation of some session app objects, and the site is pretty
clean.
>
> But over the weekend, I found a problem that I am seeking advice from.
> For some reason, the mysql database went down, causing the site to be all
screwed up.
> I have extended the RequestProcessor but can not figure out how to handle
errors from the database.

First, are you saying that you had database problems in the Filter code?  If
so, if it throws an exception that request will never make it to Struts.
You can configure some error handling in web.xml, but the location has to be
'a resource within the webapp' which IME seems to mean a JSP or HTML page.
(I have not tried sending them to an Action, but a Tiles def doesn't work in
web.xml.)

I don't know about extending the RequestProcessor, but you can "catch"
exceptions by using the <exception> tag in struts-config.xml.  Google for
'struts declarative exception handling' for more info.

I use it very simply, with an <exception> tag nested in the <action>
mapping:
 <exception type="edu.example.dao.DAOException"
               key="error.dao.exception"
               path="den.exception"/>
(den.exception is a Tiles definition.)

You can write your own ExceptionHandler if you need to do more than send
them to a page.


HTH,
Wendy Smoak


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

Reply via email to