SimpleMappingExceptionResolver.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:class-guard 作者:
/**
 * 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;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号