Hi, Scott, Wherever you access the database and encounter the error is where the error should be handled. A rule-of-thumb I employ is to handle all errors as soon as possible and as near to the actual error as possible. I think that testing to see if your database is working is not a good idea. You have to assume that your database is working and then handle what to do if it is not.
Depending on some subclass of RequestProcessor really weds your code to Struts in a way that is not good in my opinion. If you handle the error where it happens, then that should cover you completely. Your response to an error should be, I think, with a different ActionForward and not with a different (chained) Action. Thus, the sequence would be: (1) use Action, (2) hand off to business logic, (3) access to database, (4) FAILURE and consequent handling of error back to the Action which then uses a (5) "failure" ActionForward with an ActionMessage or ActionError delineating what happened to the client. On 6/1/05, Scott Purcell <[EMAIL PROTECTED]> wrote: > Hello, > > 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. > > I would like to in the requestProcessor extended class, possibly do a simple > query against a known table, and if the result is null, switch them to a site > down action class. > > Can this be done in the requestProcessor area? > > Any advice would be appreciated. > > Scott > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]