소스 검색

Prove that 403 errors are handled by web.xml <error-page>.

Ben Alex 20 년 전
부모
커밋
c64a3770de
2개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      samples/contacts/src/main/webapp/filter/WEB-INF/web.xml
  2. 5 0
      samples/contacts/src/main/webapp/filter/error.html

+ 6 - 1
samples/contacts/src/main/webapp/filter/WEB-INF/web.xml

@@ -44,7 +44,7 @@
       <filter-name>Acegi Filter Chain Proxy</filter-name>
       <url-pattern>/*</url-pattern>
     </filter-mapping>
-
+	
 	<!--
 	  - Loads the root application context of this web app at startup.
 	  - The application context is then available via 
@@ -98,6 +98,11 @@
  	<welcome-file-list>
 		<welcome-file>index.jsp</welcome-file>
 	</welcome-file-list>
+	
+	<error-page>
+		<error-code>403</error-code>
+		<location>/error.html</location>
+	</error-page>
 
   	<taglib>
       <taglib-uri>/spring</taglib-uri>

+ 5 - 0
samples/contacts/src/main/webapp/filter/error.html

@@ -0,0 +1,5 @@
+<html>
+	<title>Access denied!</title>
+	<h1>Access Denied</h1>
+	We're sorry, but you are not authorized to perform the requested operation.
+</html>