diff --git a/common/src/main/java/com/jeesite/common/lang/ExceptionUtils.java b/common/src/main/java/com/jeesite/common/lang/ExceptionUtils.java index 5e167b2a..fade7e45 100644 --- a/common/src/main/java/com/jeesite/common/lang/ExceptionUtils.java +++ b/common/src/main/java/com/jeesite/common/lang/ExceptionUtils.java @@ -5,11 +5,11 @@ */ package com.jeesite.common.lang; +import javax.servlet.RequestDispatcher; +import javax.servlet.http.HttpServletRequest; import java.io.PrintWriter; import java.io.StringWriter; -import javax.servlet.http.HttpServletRequest; - /** * 关于异常的工具类. * @author calvin @@ -26,8 +26,8 @@ public class ExceptionUtils { Throwable ex = null; if (request.getAttribute("exception") != null) { ex = (Throwable) request.getAttribute("exception"); - } else if (request.getAttribute("javax.servlet.error.exception") != null) { - ex = (Throwable) request.getAttribute("javax.servlet.error.exception"); + } else if (request.getAttribute(RequestDispatcher.ERROR_EXCEPTION) != null) { + ex = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); } return ex; }