Hi,

try changing the exception handler in struts-config.xml to

<exception
      key="errors.database.noconnection"
      type="mydomain.exception.TrcDatabaseException"
      path="/common/exceptionTrcDatabase.jsp"
      />

You can get rid of the whole catch block in your action--the
ActionServlet takes care of it.  That's the beauty of declarative
exceptions.

-- Bill


>> Wherever an exception is thrown in AuthenticateAction, I add some
code in
>> the catch block, before rethrowing it, for example like this:
>>
>> } catch(TrcDatabaseException ex){
>> /* add relevant action errors */
>> ActionErrors errors = new ActionErrors();
>> errors.add(ActionErors.GLOBAL_ERROR, new
>> ActionError("errors.database.noconnection"));
>> saveErrors(request, errors);
>> /* rethrow the exception to be caught by Struts declarative exception
>> handling mechanism */
>> throw ex;
>> }
>>
>> I have also placed an errors.database.noconnection in the resource file.
>>
>> In the struts-config file, for the AuthenticateAction, I have defined an
>> exception element:
>>
>> <exception
>> key="errors.generalmessage"
>> type="mydomain.exception.TrcDatabaseException"
>> path="/common/exceptionTrcDatabase.jsp"
>> />
>>
>> I have created a JSP, exceptionTrcDatabase.jsp, that contains this
element:
>>
>> <html:errors/>
>>
>> However, whenever I test this code (by deliberately creating the
relevant
>> error conditions), only the errors.generalmessage is displayed.
>>
>> Why isn't the errors.database.noconnection being displayed as well?


-- Bill Schneider Chief Architect Vecna Technologies, Inc. 5004 Lehigh Road, Suite B College Park, MD 20740 [EMAIL PROTECTED] t: 301-864-7594 f: 301-699-3180
--
Bill Schneider
Chief Architect


Vecna Technologies, Inc.
5004 Lehigh Road, Suite B
College Park, MD 20740
[EMAIL PROTECTED]
t: 301-864-7594
f: 301-699-3180


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



Reply via email to