Announcement Announcement Module
Collapse
No announcement yet.
Custom ExceptionHandler defined via XML not working with <mvc:annotation-driven/> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom ExceptionHandler defined via XML not working with <mvc:annotation-driven/>

    Hello everyone, I ended up writing here a post after half a day trying to understand why my custom defined ExceptionHandler is not invoked when I enable <mvc:annotation-driven/>.

    Before (working)
    Code:
    <bean id="myExceptionHandler" class="com.creonomy.board.web.ExceptionHandler"/>
    After (not working)
    Code:
    <mvc:annotation-driven/>
    <bean id="myExceptionHandler" class="com.creonomy.board.web.ExceptionHandler"/>
    I'm using spring 3.1

    Am I missing something about this version? Any help on how to configure a GLOBAL exception handler via XML with <mvc:annotation-driven/> enabled would be super much appreciated. Thanks.

  • #2
    I suggest a read of the reference guide.

    mvc:annotation driven registers ExceptionHandlers for you and those are ordered, yours isn't and hence is always the last in the chain. Make yours ordered and give it an order before the default exception handlers.

    Comment

    Working...
    X