/**
* Actually resolve the given exception that got thrown during on handler execution,
* returning a ModelAndView that represents a specific error page if appropriate.
* @param request current portlet request
* @param response current portlet response
* @param handler the executed handler, or null if none chosen at the time of
* the exception (for example, if multipart resolution failed)
* @param ex the exception that got thrown during handler execution
* @return a corresponding ModelAndView to forward to, or null for default processing
*/
@Override
protected ModelAndView doResolveException(
PortletRequest request, MimeResponse response, Object handler, Exception ex) {
// Log exception, both at debug log level and at warn level, if desired.
if (logger.isDebugEnabled()) {
logger.debug("Resolving exception from handler [" + handler + "]: " + ex);
}
logException(ex, request);
// Expose ModelAndView for chosen error view.
String viewName = determineViewName(ex, request);
if (viewName != null) {
return getModelAndView(viewName, ex, request);
}
else {
return null;
}
}
SimpleMappingExceptionResolver.java 文件源码
java
阅读 15
收藏 0
点赞 0
评论 0
项目:spring4-understanding
作者:
评论列表
文章目录