(158) - 对配置,代码必要的地方添加注释,方便理解
parent
95b7296dbc
commit
8a826aa0d2
|
@ -8,12 +8,21 @@
|
||||||
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spring MVC 配置
|
||||||
|
-->
|
||||||
<!--<import resource="security.xml"/>-->
|
<!--<import resource="security.xml"/>-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
启用注解
|
||||||
|
-->
|
||||||
<!--annotation configuration -->
|
<!--annotation configuration -->
|
||||||
<context:annotation-config/>
|
<context:annotation-config/>
|
||||||
<context:component-scan base-package="com.monkeyk.sos.web"/>
|
<context:component-scan base-package="com.monkeyk.sos.web"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
静态资源直接映射具体的路径
|
||||||
|
-->
|
||||||
<!--static resource-->
|
<!--static resource-->
|
||||||
<mvc:resources mapping="/index.jsp*" location="/index.jsp"/>
|
<mvc:resources mapping="/index.jsp*" location="/index.jsp"/>
|
||||||
<mvc:resources mapping="/resources/**" location="/resources/"/>
|
<mvc:resources mapping="/resources/**" location="/resources/"/>
|
||||||
|
@ -21,6 +30,9 @@
|
||||||
<!--<mvc:annotation-driven/>-->
|
<!--<mvc:annotation-driven/>-->
|
||||||
<!--<mvc:default-servlet-handler/>-->
|
<!--<mvc:default-servlet-handler/>-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ViewResolver, 处理视图
|
||||||
|
-->
|
||||||
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||||
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
|
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
|
||||||
<property name="prefix" value="/WEB-INF/jsp/"/>
|
<property name="prefix" value="/WEB-INF/jsp/"/>
|
||||||
|
|
|
@ -7,12 +7,20 @@
|
||||||
|
|
||||||
<display-name>spring-oauth-server</display-name>
|
<display-name>spring-oauth-server</display-name>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
distributable
|
||||||
|
应用支持在分布式Web容器中部署
|
||||||
|
-->
|
||||||
<distributable/>
|
<distributable/>
|
||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>webAppRootKey</param-name>
|
<param-name>webAppRootKey</param-name>
|
||||||
<param-value>spring-oauth-server</param-value>
|
<param-value>spring-oauth-server</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
字符编码Filter, 统一为UTF-8
|
||||||
|
-->
|
||||||
<!--Encoding filter-->
|
<!--Encoding filter-->
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>encodingFilter</filter-name>
|
<filter-name>encodingFilter</filter-name>
|
||||||
|
@ -31,6 +39,10 @@
|
||||||
<url-pattern>/*</url-pattern>
|
<url-pattern>/*</url-pattern>
|
||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
响应时启用GZIP压缩, 提高性能与网络传输
|
||||||
|
-->
|
||||||
<!--GzipFilter -->
|
<!--GzipFilter -->
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>gzipFilter</filter-name>
|
<filter-name>gzipFilter</filter-name>
|
||||||
|
@ -68,6 +80,9 @@
|
||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spring Security 拦截 Filter配置
|
||||||
|
-->
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>springSecurityFilterChain</filter-name>
|
<filter-name>springSecurityFilterChain</filter-name>
|
||||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||||
|
@ -78,6 +93,9 @@
|
||||||
<url-pattern>/*</url-pattern>
|
<url-pattern>/*</url-pattern>
|
||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Sitemesh, 装饰器Filter
|
||||||
|
-->
|
||||||
<!-- sitemesh filter-->
|
<!-- sitemesh filter-->
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>sitemesh</filter-name>
|
<filter-name>sitemesh</filter-name>
|
||||||
|
@ -93,6 +111,9 @@
|
||||||
<mime-type>image/vnd.microsoft.icon</mime-type>
|
<mime-type>image/vnd.microsoft.icon</mime-type>
|
||||||
</mime-mapping>
|
</mime-mapping>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
配置Spring Context 加载配置文件
|
||||||
|
-->
|
||||||
<!--contextConfigLocation -->
|
<!--contextConfigLocation -->
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>contextConfigLocation</param-name>
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
@ -102,15 +123,26 @@
|
||||||
<param-name>log4jConfigLocation</param-name>
|
<param-name>log4jConfigLocation</param-name>
|
||||||
<param-value>/WEB-INF/log4j.xml</param-value>
|
<param-value>/WEB-INF/log4j.xml</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Log4j 日志监听器
|
||||||
|
-->
|
||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spring Context 监听
|
||||||
|
-->
|
||||||
<!-- Spring context listener -->
|
<!-- Spring context listener -->
|
||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Spring MVC 配置
|
||||||
|
-->
|
||||||
<!--mvc-->
|
<!--mvc-->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>mkk</servlet-name>
|
<servlet-name>mkk</servlet-name>
|
||||||
|
@ -127,6 +159,9 @@
|
||||||
<!--<location>/index.jsp</location>-->
|
<!--<location>/index.jsp</location>-->
|
||||||
<!--</error-page>-->
|
<!--</error-page>-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
配置Session 有效期时间 30分钟
|
||||||
|
-->
|
||||||
<session-config>
|
<session-config>
|
||||||
<session-timeout>30</session-timeout>
|
<session-timeout>30</session-timeout>
|
||||||
</session-config>
|
</session-config>
|
||||||
|
|
Loading…
Reference in New Issue