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/403.jsp

45 lines
1.4 KiB
Plaintext
Raw Normal View History

2017-12-29 16:18:40 +08:00
<%
response.setStatus(403);
//获取异常类
Throwable ex = Exceptions.getThrowable(request);
// 如果是异步请求或是手机端,则直接返回信息
if (Servlets.isAjaxRequest(request)) {
if (ex!=null && StringUtils.startsWith(ex.getMessage(), "msg:")){
out.print(StringUtils.replace(ex.getMessage(), "msg:", ""));
}else{
out.print("<spring:message code=\"no_permission\"/>.");
2017-12-29 16:18:40 +08:00
}
}
//输出异常信息页面
else {
%>
<%@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>403 - <spring:message code="no_permission"/></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><spring:message code="no_permission"/>-403.</h1></div>
2017-12-29 16:18:40 +08:00
<%
if (ex!=null && StringUtils.startsWith(ex.getMessage(), "msg:")){
out.print("<div>"+StringUtils.replace(ex.getMessage(), "msg:", "")+" <br/> <br/></div>");
}
%>
<div><a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a></div>
2017-12-29 16:18:40 +08:00
<script>try{top.$.jBox.closeTip();}catch(e){}</script>
</div>
</body>
</html>
<%
} out = pageContext.pushBody();
%>