You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Keith Sader <ks...@gmail.com> on 2005/02/26 21:48:48 UTC

Declarative exception handling behaving wierdly.

I'm trying to experiment with declarative exceptions.  When I add a
global handler that deals with java.lang.Exception, I get redirected
to my global error page as I expect.  However, when I add an action
specific handler, I still get directed to the global page instead of
to the action specific page.  The docs indicate that the action
specific handler will take precedence over the global handler, but I
don't observe this happening.  Has anyone else had this issue?

Action class excerpt:
my.search.SearchAction
    public ActionForward execute(...) {
        throw new my.search.SearchException("SearchException");
    }

Here's an excerpt of my struts-config.xml

<global-exceptions>
    <exception key="errors.system.error" scope="request"
type="java.lang.Exception" path="Global/SystemError.jsp"/>
</global-exceptions>
...
<action input="/Tools/Details.jsp" name="SearchForm" path="/Tools/Search"
        scope="request" type="my.search.SearchAction" validate="true">
    <exception key="errors.bogus.error"
type="my.search.SearchException" path="/Tools/Search_Error.jsp"/>
    <forward name="success" path="/Tools/SearchReport.jsp"/>
</action>

thanks,
-- 
Keith Sader
ksader@gmail.com
http://www.saderfamily.org/roller/page/ksader

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org