mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 01:18:27 +08:00
tomcat9 support
can deploy springboot to tomcat or run use MaxKeyApplication/MaxKeyMgtApplication
This commit is contained in:
parent
54fb775696
commit
de8c840d80
@ -102,15 +102,15 @@ public class TokenBasedAuthorizeEndpoint extends AuthorizeBaseEndpoint{
|
||||
//
|
||||
//cookie.setDomain("."+applicationConfig.getSubDomainName());
|
||||
//tomcat 8.5
|
||||
cookie.setDomain(applicationConfig.getSubDomainName());
|
||||
cookie.setDomain(applicationConfig.getDomainName());
|
||||
|
||||
_logger.debug("Sub Domain Name : "+"."+applicationConfig.getSubDomainName());
|
||||
_logger.debug("Sub Domain Name : "+"."+applicationConfig.getDomainName());
|
||||
response.addCookie(cookie);
|
||||
|
||||
if(tokenBasedDetails.getRedirectUri().indexOf(applicationConfig.getSubDomainName())>-1){
|
||||
if(tokenBasedDetails.getRedirectUri().indexOf(applicationConfig.getDomainName())>-1){
|
||||
return WebContext.redirect(tokenBasedDetails.getRedirectUri());
|
||||
}else{
|
||||
_logger.error(tokenBasedDetails.getRedirectUri()+" not in domain "+applicationConfig.getSubDomainName());
|
||||
_logger.error(tokenBasedDetails.getRedirectUri()+" not in domain "+applicationConfig.getDomainName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
169
maxkey-web-manage/src/main/webapp/WEB-INF/web.backup.xml
Normal file
169
maxkey-web-manage/src/main/webapp/WEB-INF/web.backup.xml
Normal file
@ -0,0 +1,169 @@
|
||||
<?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 Management</display-name>
|
||||
<!-- webAppRootKey -->
|
||||
<context-param>
|
||||
<param-name>webAppRootKey</param-name>
|
||||
<param-value>org.maxkey.management.root</param-value>
|
||||
</context-param>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>InitWebContext</servlet-name>
|
||||
<servlet-class>org.maxkey.web.InitWebContext</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>/WEB-INF/spring/maxkey-mgt.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>
|
||||
|
||||
<!-- DispatcherServlet Spring MVC -->
|
||||
<servlet>
|
||||
<servlet-name>maxkey-mgt</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>maxkey-mgt</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-mgt</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>
|
||||
|
||||
<!--used jsp Tag -->
|
||||
<jsp-config>
|
||||
<taglib>
|
||||
<taglib-uri>http://sso.maxkey.org/tags</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/maxkeyTag.tld</taglib-location>
|
||||
</taglib>
|
||||
<taglib>
|
||||
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/c.tld</taglib-location>
|
||||
</taglib>
|
||||
</jsp-config>
|
||||
</web-app>
|
||||
@ -14,156 +14,4 @@
|
||||
<param-value>org.maxkey.management.root</param-value>
|
||||
</context-param>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>InitWebContext</servlet-name>
|
||||
<servlet-class>org.maxkey.web.InitWebContext</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>/WEB-INF/spring/maxkey-mgt.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>
|
||||
|
||||
<!-- DispatcherServlet Spring MVC -->
|
||||
<servlet>
|
||||
<servlet-name>maxkey-mgt</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>maxkey-mgt</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-mgt</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>
|
||||
|
||||
<!--used jsp Tag -->
|
||||
<jsp-config>
|
||||
<taglib>
|
||||
<taglib-uri>http://sso.maxkey.org/tags</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/maxkeyTag.tld</taglib-location>
|
||||
</taglib>
|
||||
<taglib>
|
||||
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/c.tld</taglib-location>
|
||||
</taglib>
|
||||
</jsp-config>
|
||||
</web-app>
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<!DOCTYPE HTML >
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
<title>MaxKey Management</title>
|
||||
<link type="text/css" rel="stylesheet" href="<c:url value="/style.css"/>"/>
|
||||
</head>
|
||||
<body>
|
||||
<c:redirect url="/login"/>
|
||||
</body>
|
||||
</html>
|
||||
179
maxkey-web-maxkey/src/main/webapp/WEB-INF/web.backup.xml
Normal file
179
maxkey-web-maxkey/src/main/webapp/WEB-INF/web.backup.xml
Normal file
@ -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>
|
||||
@ -7,183 +7,11 @@
|
||||
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 security</display-name>
|
||||
<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>InitWebContext</servlet-name>
|
||||
<servlet-class>org.maxkey.web.InitWebContext</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>/WEB-INF/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>
|
||||
|
||||
<!--used jsp Tag -->
|
||||
<jsp-config>
|
||||
<taglib>
|
||||
<taglib-uri>http://sso.maxkey.org/tags</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/maxkeyTag.tld</taglib-location>
|
||||
</taglib>
|
||||
<taglib>
|
||||
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
|
||||
<taglib-location>/WEB-INF/tags/c.tld</taglib-location>
|
||||
</taglib>
|
||||
</jsp-config>
|
||||
</web-app>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user