|
From: Boyce, K. G. <Kei...@bc...> - 2005-11-16 00:16:06
|
The relavent code as seen below is where exception is thrown, exception
resolver handles error, render occurs but because it hasn't determined
the mappedHandler triggerAfterCompletion does nothing:
try {
....
PortletSession session =3D
request.getPortletSession(false);
if (session !=3D null) {
if
(TRUE.equals(request.getParameter(ACTION_EXCEPTION_PARAMETER))) {
Exception ex =3D
(Exception)session.getAttribute(ACTION_EXCEPTION_SESSION_ATTRIBUTE);
if (ex !=3D null) {
logger.error("render
phase found exception caught during action phase -- rethrowing it");
throw ex;
}
} else {
=0D
session.removeAttribute(ACTION_EXCEPTION_SESSION_ATTRIBUTE);
}
}
=0D
// Determine handler for the current
request.
mappedHandler =3D
getHandler(processedRequest, false);
}
catch (Exception ex) {
Object handler =3D (mappedHandler !=3D null
? mappedHandler.getHandler() : null);
mv =3D processHandlerException(request,
response, handler, ex);
}
// Did the handler return a view to render?
if (mv !=3D null && !(mv.getView() =3D=3D null &&
mv.getViewName() =3D=3D null && mv.getModel() =3D=3D null)) {
render(mv, processedRequest, response);
}
...
private void triggerAfterCompletion(
HandlerExecutionChain mappedHandler, int
interceptorIndex,
PortletRequest request, PortletResponse
response, Exception ex)
throws Exception {
// Apply afterCompletion methods of registered
interceptors.
if (mappedHandler !=3D null) {
=0D
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf
Of Seth Ladd
Sent: Tuesday, November 15, 2005 6:45 PM
To: spr...@li...
Subject: Re: [Springframework-developer] HandlerExceptionResolver not
catching taglib exceptions?
On 11/15/05, Boyce, Keith Garry <Kei...@bc...> wrote:
>
> But that's the whole deal about the exception resolver. We configure=0D
> the interceptors for a particular handler to handle particular use=0D
> cases and we need someway to to intercept just that.. Isn't there a=0D
> way we can implement the interceptor concept for exceptions.
Oops, I misread the description for afterCompletion:
* Callback after completion of request processing, that is,
after rendering
* the view. Will be called on any outcome of handler execution,
thus allows
* for proper resource cleanup.
So afterCompletion is after the view rendering. Why this isn't picking
up exceptions thrown by your taglibs, I'm not sure.
Seth
-------------------------------------------------------
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_idv28&alloc_id=16845&op=3Dick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
This message is a PRIVATE communication.
If you are not the intended recipient, please do not read, copy,
or use it, and do not disclose it to others. Please notify the
sender of the delivery error by replying to this message, and then
delete it from your system. Thank you.
|