|
From: Juergen H. <ju...@in...> - 2005-11-17 16:24:02
|
Well, a HandlerExceptionResolver is just expected to resolve exceptions thrown by the actual handlers: that is, the Controllers or other handler objects executed by a HandlerAdapter. The main reason for this is that a HandlerExceptionResolver assumes to be able to redirect to a ModelAndView, which is only cleanly possible as long as view rendering hasn't started yet. If an exception is raised during view rendering, parts of the view are likely to already have been sent to the client, so redirecting to an error view is not possible anymore. If you nevertheless want to handle such exceptions, for example for logging, consider implementing a standard Servlet Filter for this, which will catch exceptions thrown during view rendering as well. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Tim Kettering Sent: Tuesday, November 15, 2005 9:32 PM To: spr...@li... Subject: [Springframework-developer] HandlerExceptionResolver not catching taglib exceptions? I'm doing some work with the spring-portlet MVC in our current project, and one thing I ran across recently is that apparently the HandlerExceptionResolver on the portlet side does not catch Exceptions thrown from a taglib (a custom taglib for example). I've tested this out by issuing the same exception from inside the handler itself, which was caught as expected, but throwing that exception from a taglib itself is not caught. So it seems that the HandlerExceptionResolver does not handle exceptions that are issued after the flow of control is handed over to the view phase. I e-mailed John Lewis about this, and he said he thinks this is how it also performs on the servlet-MVC side as well. Since we do not have any servlet-MVC code here, I thought I'd ask on the list to see if this is indeed true as well. If so, what would be the correct way to handle exceptions issued by taglibs, using spring MVC? Thanks! -tim ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |