前端采用log4j打印异常信息
<%@ include file="/common/taglibs.jsp" %>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<title>Data Access Error</title>
<head>
<meta name="heading" content="System Exception"/>
<meta name="menu" content="AdminMenu"/>
</head>
<p>
<c:out value="${requestScope.exception.message}"/>
</p>
<%
Throwable ex = (Exception) request.getAttribute("exception");
Logger logger = Logger.getLogger("systemError.jsp");
logger.error(ex.getMessage(),ex);
//((Exception) request.getAttribute("exception")).printStackTrace(new java.io.PrintWriter(out));
%>
系统发生异常,请重新登录!
<a href="mainMenu.html" onclick="history.back();return false">« Login</a>