Content Model : (module-name? | ((((description*, display-name*, icon*)) | distributable | context-param | filter | filter-mapping | listener | servlet | servlet-mapping | session-config | mime-mapping | welcome-file-list | error-page | jsp-config | security-constraint | login-config | security-role | ((env-entry*, ejb-ref*, ejb-local-ref*, ((service-ref*)), resource-ref*, resource-env-ref*, message-estination-ref*, persistence-context-ref*, persistence-unit-ref*, post- construct*, pre-destroy*, data-source*)) | message-destination | locale-encoding-mapping-list)) | absolute-ordering)*
可知<welcome-file-list> 之后添加
<error-page>
<exception-type>cn.itcast.estore.exception.PrivilegeException</exception-type>
<location>/error/privilegeError.jsp</location>
</error-page>
privilegeError.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<h4>权限不足</h4>
package cn.itcast.estore.exception;
public class PrivilegeException extends RuntimeException {
public PrivilegeException() {
super();
}
public PrivilegeException(String message, Throwable cause,
boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public PrivilegeException(String message, Throwable cause) {
super(message, cause);
}
public PrivilegeException(String message) {
super(message);
}
public PrivilegeException(Throwable cause) {
super(cause);
}
}