|
From: Matt S. <mat...@sp...> - 2006-07-21 19:37:08
|
HandlerInterceptors actually intercept both handlers and views, whereas HandlerExceptionResolvers only resolve exceptions for handlers. Just wanted to point this out... Matt |
|
From: Juergen H. <ju...@in...> - 2006-07-22 10:15:07
|
Point taken, Matt. I'm not opposed to adding callback support for view exceptions. However, we can't get rid of the issue that a view exception will usually lead into a situation where we can't render a proper error page anymore, since we already sent part of the original response to the client... Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Matt Sgarlata Sent: Friday, July 21, 2006 9:36 PM To: spr...@li... Subject: [Springframework-developer] HandlerInterceptor is a misleading name HandlerInterceptors actually intercept both handlers and views, whereas HandlerExceptionResolvers only resolve exceptions for handlers. Just wanted to point this out... Matt ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Arjen P. <ar...@in...> - 2006-07-22 10:20:32
|
Well, you could figure out if the response has already been rendered by calling isCommitted() on the HttpServletResponse. If it isn't, you can call reset(), and render a new error page response. I'm not saying that we should, I'm just showing that there is a possibility. Arjen On 22-jul-2006, at 12:15, Juergen Hoeller wrote: > Point taken, Matt. > > I'm not opposed to adding callback support for view exceptions. > However, we > can't get rid of the issue that a view exception will usually lead > into a > situation where we can't render a proper error page anymore, since we > already sent part of the original response to the client... > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On > Behalf > Of Matt Sgarlata > Sent: Friday, July 21, 2006 9:36 PM > To: spr...@li... > Subject: [Springframework-developer] HandlerInterceptor is a > misleading name > > HandlerInterceptors actually intercept both handlers and views, > whereas > HandlerExceptionResolvers only resolve exceptions for handlers. > Just wanted > to point this out... > > Matt > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT Join > SourceForge.net's > Techsay panel and you'll get the chance to share your opinions on IT & > business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn > cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Matt S. <mat...@sp...> - 2006-07-24 14:00:23
|
Yeah, the response may already be screwed up, but there's still the
potential to log the error or email the sys admin. I implemented this
functionality in my app very easily as follows
public class ViewExceptionInterceptor extends HandlerInterceptorAdapter {
private static final Logger logger =
Logger.getLogger(ViewExceptionInterceptor.class);
public void afterCompletion(HttpServletRequest request,
HttpServletResponse response, Object handler, Exception ex) throws
Exception {
if (ex != null) {
logger.error("Error while rendering view", ex);
}
super.afterCompletion(request, response, handler, ex);
}
}
I just posted this on dev because I thought if there's ever a time to
reconsider the name for HandlerInterceptor it's now, since AFAIK the
interface is new in Spring 2, and Spring 2 hasn't technically been
released yet. RequestInterceptor or WebInterceptor might be a better name.
Matt
Juergen Hoeller wrote:
> Point taken, Matt.
>
> I'm not opposed to adding callback support for view exceptions. However, we
> can't get rid of the issue that a view exception will usually lead into a
> situation where we can't render a proper error page anymore, since we
> already sent part of the original response to the client...
>
> Juergen
>
>
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...] On Behalf
> Of Matt Sgarlata
> Sent: Friday, July 21, 2006 9:36 PM
> To: spr...@li...
> Subject: [Springframework-developer] HandlerInterceptor is a misleading name
>
> HandlerInterceptors actually intercept both handlers and views, whereas
> HandlerExceptionResolvers only resolve exceptions for handlers. Just wanted
> to point this out...
>
> Matt
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's
> Techsay panel and you'll get the chance to share your opinions on IT &
> business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|
|
From: Colin Y. <col...@gm...> - 2006-07-24 14:04:07
|
Matt, HandlerInterceptor ( http://www.springframework.org/docs/api/org/springframework/web/servlet/HandlerInterceptor.html) has been around for quite a long time and I am sure a lot of people are using it. Outright removal of this interface (i.e. by renaming) would cause a world of pain ;) Col On 24/07/06, Matt Sgarlata <mat...@sp...> wrote: > > Yeah, the response may already be screwed up, but there's still the > potential to log the error or email the sys admin. I implemented this > functionality in my app very easily as follows > > public class ViewExceptionInterceptor extends HandlerInterceptorAdapter { > > private static final Logger logger = > Logger.getLogger(ViewExceptionInterceptor.class); > > public void afterCompletion(HttpServletRequest request, > HttpServletResponse response, Object handler, Exception ex) throws > Exception { > if (ex != null) { > logger.error("Error while rendering view", ex); > } > > super.afterCompletion(request, response, handler, ex); > } > > } > > > I just posted this on dev because I thought if there's ever a time to > reconsider the name for HandlerInterceptor it's now, since AFAIK the > interface is new in Spring 2, and Spring 2 hasn't technically been > released yet. RequestInterceptor or WebInterceptor might be a better > name. > > Matt > > Juergen Hoeller wrote: > > Point taken, Matt. > > > > I'm not opposed to adding callback support for view exceptions. However, > we > > can't get rid of the issue that a view exception will usually lead into > a > > situation where we can't render a proper error page anymore, since we > > already sent part of the original response to the client... > > > > Juergen > > > > > > -----Original Message----- > > From: spr...@li... > > [mailto:spr...@li...] On > Behalf > > Of Matt Sgarlata > > Sent: Friday, July 21, 2006 9:36 PM > > To: spr...@li... > > Subject: [Springframework-developer] HandlerInterceptor is a misleading > name > > > > HandlerInterceptors actually intercept both handlers and views, whereas > > HandlerExceptionResolvers only resolve exceptions for handlers. Just > wanted > > to point this out... > > > > Matt > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net > 's > > Techsay panel and you'll get the chance to share your opinions on IT & > > business topics through brief surveys -- and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys -- and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |