一,添加 Errorhandler
当访问页面出现相应错误时,则跳转到对应的页面。
http://localhost:4502/crx/de/index.jsp#/apps/sling/servlet/errorhandler
二,代码
.content.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="sling:Folder"/>
404.jsp
<%@page session="false"%><%
%><%@include file="/apps/acs-commons/components/utilities/errorpagehandler/404.jsp" %>
default.jsp
<%@page session="false"%><%
%><%@include file="/apps/acs-commons/components/utilities/errorpagehandler/default.jsp" %>
403.jsp
<%@page session="false"%>
<%
response.setStatus(403);
%>
<%@ page pageEncoding="UTF-8"%>
<div>
You don't have permission to visit this site. Please contact admin to setup permissions for you. Contact: test@163.com<br/>
您没有权限访问该网站。请联系管理员为您设置权限。联系方式:test@163.com
</div>