2017-12-29 16:18:40 +08:00
|
|
|
|
<%
|
|
|
|
|
|
response.setStatus(500);
|
|
|
|
|
|
|
|
|
|
|
|
// 获取异常类
|
|
|
|
|
|
Throwable ex = Exceptions.getThrowable(request);
|
|
|
|
|
|
if (ex != null){
|
|
|
|
|
|
LoggerFactory.getLogger("500.jsp").error(ex.getMessage(), ex);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 编译错误信息
|
2018-05-21 14:10:11 +08:00
|
|
|
|
StringBuilder sb = new StringBuilder("<spring:message code=\"exception_info\"/>:\n");
|
2017-12-29 16:18:40 +08:00
|
|
|
|
if (ex != null) {
|
|
|
|
|
|
sb.append(Exceptions.getStackTraceAsString(ex));
|
|
|
|
|
|
} else {
|
2018-05-21 14:10:11 +08:00
|
|
|
|
sb.append("<spring:message code=\"unkown_error\"/>.\n\n");
|
2017-12-29 16:18:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 如果是异步请求或是手机端,则直接返回信息
|
|
|
|
|
|
if (Servlets.isAjaxRequest(request)) {
|
|
|
|
|
|
out.print(sb);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 输出异常信息页面
|
|
|
|
|
|
else {
|
|
|
|
|
|
%>
|
|
|
|
|
|
<%@page import="org.slf4j.Logger,org.slf4j.LoggerFactory"%>
|
|
|
|
|
|
<%@page import="com.nis.web.security.Servlets"%>
|
|
|
|
|
|
<%@page import="com.nis.util.Exceptions"%>
|
|
|
|
|
|
<%@page import="com.nis.util.StringUtils"%>
|
|
|
|
|
|
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
|
|
|
|
|
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
<html>
|
|
|
|
|
|
<head>
|
2018-05-21 14:10:11 +08:00
|
|
|
|
<title>500 - <spring:message code="system_error"/></title>
|
2017-12-29 16:18:40 +08:00
|
|
|
|
<%@include file="/WEB-INF/include/header.jsp" %>
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
|
|
|
<div class="container-fluid">
|
2018-05-21 14:10:11 +08:00
|
|
|
|
<div class="page-header"><h1>500-<spring:message code="system_error"/>.</h1></div>
|
2017-12-29 16:18:40 +08:00
|
|
|
|
<div class="errorMessage">
|
2018-05-21 14:10:11 +08:00
|
|
|
|
<spring:message code="exception_info"/>:<%=ex==null?"<spring:message code=\"unkown_error\"/>.":StringUtils.toHtml(ex.getMessage())%> <br/> <br/>
|
|
|
|
|
|
<!-- 请点击“查看详细信息”按钮,将详细错误信息发送给系统管理员,谢谢! -->
|
|
|
|
|
|
<spring:message code="click_detail"/><br/> <br/>
|
|
|
|
|
|
<a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a>
|
|
|
|
|
|
<a href="javascript:" onclick="$('.errorMessage').toggle();" class="btn"><spring:message code="show_detail"/></a>
|
2017-12-29 16:18:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="errorMessage hide">
|
|
|
|
|
|
<%=StringUtils.toHtml(sb.toString())%> <br/>
|
2018-05-21 14:10:11 +08:00
|
|
|
|
<a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a>
|
|
|
|
|
|
<a href="javascript:" onclick="$('.errorMessage').toggle();" class="btn"><spring:message code="hidden_detail"/></a>
|
2017-12-29 16:18:40 +08:00
|
|
|
|
<br/> <br/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<script>try{top.$.jBox.closeTip();}catch(e){}</script>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
<%
|
|
|
|
|
|
} out = pageContext.pushBody();
|
|
|
|
|
|
%>
|