|
@@ -0,0 +1,179 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
|
|
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
|
|
|
+ xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp"
|
|
|
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
|
|
+ version="2.4">
|
|
|
+
|
|
|
+ <display-name>MaxKey Single Sign On</display-name>
|
|
|
+ <!-- webAppRootKey -->
|
|
|
+ <context-param>
|
|
|
+ <param-name>webAppRootKey</param-name>
|
|
|
+ <param-value>org.maxkey.root</param-value>
|
|
|
+ </context-param>
|
|
|
+
|
|
|
+ <servlet>
|
|
|
+ <servlet-name>InitApplicationContext</servlet-name>
|
|
|
+ <servlet-class>org.maxkey.web.InitApplicationContext</servlet-class>
|
|
|
+ <load-on-startup>1</load-on-startup>
|
|
|
+ </servlet>
|
|
|
+ <!--
|
|
|
+ <servlet-mapping>
|
|
|
+ <servlet-name>InitWebContext</servlet-name>
|
|
|
+ <url-pattern>/</url-pattern>
|
|
|
+ </servlet-mapping> -->
|
|
|
+
|
|
|
+ <!-- contextConfigLocation -->
|
|
|
+ <context-param>
|
|
|
+ <param-name>contextConfigLocation</param-name>
|
|
|
+ <param-value>classpath:spring/maxkey.xml</param-value>
|
|
|
+ </context-param>
|
|
|
+
|
|
|
+ <!-- log4jConfigLocation
|
|
|
+ <context-param>
|
|
|
+ <param-name>log4jConfigLocation</param-name>
|
|
|
+ <param-value>classpath:log4j.properties</param-value>
|
|
|
+ </context-param> -->
|
|
|
+ <context-param>
|
|
|
+ <param-name>log4jRefreshInterval</param-name>
|
|
|
+ <param-value>60000</param-value>
|
|
|
+ </context-param>
|
|
|
+ <!-- listeners
|
|
|
+ <listener>
|
|
|
+ <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
|
|
+ </listener>
|
|
|
+ <listener>
|
|
|
+ <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
|
|
|
+ </listener>
|
|
|
+ <listener>
|
|
|
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
|
|
+ </listener>
|
|
|
+ <listener>
|
|
|
+ <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
|
|
|
+ </listener>
|
|
|
+ -->
|
|
|
+ <!-- log4j -->
|
|
|
+ <context-param>
|
|
|
+ <param-name>isLog4jAutoInitializationDisabled</param-name>
|
|
|
+ <param-value>false</param-value>
|
|
|
+ </context-param>
|
|
|
+ <!-- 默认就会找这个文件,不需要额外配置引用 -->
|
|
|
+ <context-param>
|
|
|
+ <param-name>log4jConfiguration</param-name>
|
|
|
+ <param-value>classpath:log4j2.xml</param-value>
|
|
|
+ </context-param>
|
|
|
+
|
|
|
+ <!-- 在WEB项目中使用log4j2需要在web.xml文件中配置如下的监听器和过滤器 -->
|
|
|
+ <listener>
|
|
|
+ <listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
|
|
|
+ </listener>
|
|
|
+
|
|
|
+ <filter>
|
|
|
+ <filter-name>log4jServletFilter</filter-name>
|
|
|
+ <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
|
|
|
+ </filter>
|
|
|
+ <filter-mapping>
|
|
|
+ <filter-name>log4jServletFilter</filter-name>
|
|
|
+ <url-pattern>/*</url-pattern>
|
|
|
+ <dispatcher>REQUEST</dispatcher>
|
|
|
+ <dispatcher>FORWARD</dispatcher>
|
|
|
+ <dispatcher>INCLUDE</dispatcher>
|
|
|
+ <dispatcher>ERROR</dispatcher>
|
|
|
+ </filter-mapping>
|
|
|
+ <!-- CharacterEncodingFilter -->
|
|
|
+ <filter>
|
|
|
+ <filter-name>characterEncodingFilter</filter-name>
|
|
|
+ <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
|
|
+ <init-param>
|
|
|
+ <param-name>encoding</param-name>
|
|
|
+ <param-value>UTF-8</param-value>
|
|
|
+ </init-param>
|
|
|
+ <init-param>
|
|
|
+ <param-name>forceEncoding</param-name>
|
|
|
+ <param-value>true</param-value>
|
|
|
+ </init-param>
|
|
|
+ </filter>
|
|
|
+ <filter-mapping>
|
|
|
+ <filter-name>characterEncodingFilter</filter-name>
|
|
|
+ <url-pattern>/*</url-pattern>
|
|
|
+ </filter-mapping>
|
|
|
+
|
|
|
+ <!-- IpAddressFilter -->
|
|
|
+ <filter>
|
|
|
+ <filter-name>ipAddressFilter</filter-name>
|
|
|
+ <filter-class>org.maxkey.web.filter.IpAddressFilter</filter-class>
|
|
|
+ </filter>
|
|
|
+ <filter-mapping>
|
|
|
+ <filter-name>ipAddressFilter</filter-name>
|
|
|
+ <url-pattern>/*</url-pattern>
|
|
|
+ </filter-mapping>
|
|
|
+
|
|
|
+
|
|
|
+ <filter>
|
|
|
+ <filter-name>OAuth20TokenEndpointAuthenticationFilter</filter-name>
|
|
|
+ <filter-class>org.maxkey.authz.oauth2.provider.endpoint.TokenEndpointAuthenticationFilter</filter-class>
|
|
|
+ </filter>
|
|
|
+ <filter-mapping>
|
|
|
+ <filter-name>OAuth20TokenEndpointAuthenticationFilter</filter-name>
|
|
|
+ <url-pattern>/oauth/v20/token</url-pattern>
|
|
|
+ </filter-mapping>
|
|
|
+
|
|
|
+ <!-- DispatcherServlet Spring MVC -->
|
|
|
+ <servlet>
|
|
|
+ <servlet-name>maxkey</servlet-name>
|
|
|
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
|
|
+ <load-on-startup>1</load-on-startup>
|
|
|
+ </servlet>
|
|
|
+ <servlet-mapping>
|
|
|
+ <servlet-name>maxkey</servlet-name>
|
|
|
+ <url-pattern>/</url-pattern>
|
|
|
+ </servlet-mapping>
|
|
|
+ <filter>
|
|
|
+ <filter-name>HiddenHttpMethodFilter</filter-name>
|
|
|
+ <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
|
|
|
+ </filter>
|
|
|
+ <filter-mapping>
|
|
|
+ <filter-name>HiddenHttpMethodFilter</filter-name>
|
|
|
+ <servlet-name>maxkey</servlet-name>
|
|
|
+ </filter-mapping>
|
|
|
+
|
|
|
+ <!-- default session timeout 30 minutes -->
|
|
|
+ <session-config>
|
|
|
+ <session-timeout>30</session-timeout>
|
|
|
+ </session-config>
|
|
|
+
|
|
|
+ <!--Error page config
|
|
|
+ <error-page>
|
|
|
+ <error-code>401</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/accessdeny.jsp</location>
|
|
|
+ </error-page>
|
|
|
+
|
|
|
+ <error-page>
|
|
|
+ <error-code>403</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/accessdeny.jsp</location>
|
|
|
+ </error-page>
|
|
|
+
|
|
|
+ <error-page>
|
|
|
+ <error-code>404</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/404.jsp</location>
|
|
|
+ </error-page>
|
|
|
+
|
|
|
+ <error-page>
|
|
|
+ <error-code>500</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/500.jsp</location>
|
|
|
+ </error-page>
|
|
|
+
|
|
|
+ <error-page>
|
|
|
+ <error-code>501</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/501.jsp</location>
|
|
|
+ </error-page>
|
|
|
+
|
|
|
+ <error-page>
|
|
|
+ <error-code>503</error-code>
|
|
|
+ <location>/WEB-INF/view/exception/503.jsp</location>
|
|
|
+ </error-page>
|
|
|
+ -->
|
|
|
+
|
|
|
+</web-app>
|