Issue Details (XML | Word | Printable)

Key: XW-115
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Matthew Porter
Reporter: Richard HALLIER
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
XWork

Exception handler mechanism

Created: 01/Nov/03 03:55 AM   Updated: 17/Aug/05 08:54 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

File Attachments: 1. HTML File 500page.jsp (1 kB)

Issue Links:
Related
 


 Description  « Hide
It would ne nice that XWork can handle exceptions, something like :
Something like :
<global-exception type="mypack.ApplicationException" action="myExceptionHandlerAction"/>
that could redirect exceptions inherited from mypack.ApplicationException to the myExceptionHandlerAction
action.
Maybe even with a configurable result type.
 

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Mathias Bogaert added a comment - 09/Feb/04 08:30 AM
This is already possible by

1. add the following to xwork.xml

<global-results>
    <result name="error">/500page.jsp</result>
</global-results>

2. add the following to WEB-INF/web.xml

<error-page>
    <error-code>500</error-code>
    <location>/500page.jsp</location>
</error-page>

3. add the attached error page to your web-app root directory

Joern Barthel added a comment - 15/Oct/04 05:39 AM
Errors during OGNL parsing (like http://jira.opensymphony.com/browse/XW-199) as well as exceptions during component lifecycle calls (as in dispose()) currently cannot (imho) be caught by using interceptor or the servlet containers error-pages.

An exception handling mechanism might be handy here.

Patrick Lightbody added a comment - 06/Aug/05 10:43 AM
Spoke with Matthew about this while he was in town. The plan is to add a generic interceptor to XWork and then add a new type of XML configuration for WebWork that makes it easier to do these types of common things. Ie: we'd add an <exception on="MyException">[some result]</exception> in webwork.xml, but that would really end up being just another interceptor placed at the end of the stack. That means we need both XW-115 and WW-598 open as they have different requirements.

Matthew Porter added a comment - 17/Aug/05 08:54 AM
This task is done. One can now declare <global-exception-mappings> at a package level and <exception-mapping> at an Action level.

Please note the new revision of the DTD and the new Interceptor (ExceptionMappingInterceptor).