This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/webapp/WEB-INF/views/error/500.jsp

60 lines
2.2 KiB
Plaintext
Raw Normal View History

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);
}
// 编译错误信息
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 {
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>
<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">
<div class="page-header"><h1>500-<spring:message code="system_error"/>.</h1></div>
2017-12-29 16:18:40 +08:00
<div class="errorMessage">
<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> &nbsp;
<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/>
<a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a> &nbsp;
<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();
%>