From 7ccbb05b7bdb05406a3b6b30de26342057df3d5d Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 1 Apr 2024 11:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/jeesite/common/lang/ExceptionUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }