Browse Source

(158) - 对配置,代码必要的地方添加注释,方便理解

0.6
LSZ 8 years ago
parent
commit
8a826aa0d2
  1. 12
      src/main/webapp/WEB-INF/mkk-servlet.xml
  2. 35
      src/main/webapp/WEB-INF/web.xml

12
src/main/webapp/WEB-INF/mkk-servlet.xml

@ -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">
<!--
Spring MVC 配置
-->
<!--<import resource="security.xml"/>-->
<!--
启用注解
-->
<!--annotation configuration -->
<context:annotation-config/>
<context:component-scan base-package="com.monkeyk.sos.web"/>
<!--
静态资源直接映射具体的路径
-->
<!--static resource-->
<mvc:resources mapping="/index.jsp*" location="/index.jsp"/>
<mvc:resources mapping="/resources/**" location="/resources/"/>
@ -21,6 +30,9 @@
<!--<mvc:annotation-driven/>-->
<!--<mvc:default-servlet-handler/>-->
<!--
ViewResolver, 处理视图
-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>

35
src/main/webapp/WEB-INF/web.xml

@ -7,12 +7,20 @@
<display-name>spring-oauth-server</display-name>
<!--
distributable
应用支持在分布式Web容器中部署
-->
<distributable/>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>spring-oauth-server</param-value>
</context-param>
<!--
字符编码Filter, 统一为UTF-8
-->
<!--Encoding filter-->
<filter>
<filter-name>encodingFilter</filter-name>
@ -31,6 +39,10 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--
响应时启用GZIP压缩, 提高性能与网络传输
-->
<!--GzipFilter -->
<filter>
<filter-name>gzipFilter</filter-name>
@ -68,6 +80,9 @@
</filter-mapping>
<!--
Spring Security 拦截 Filter配置
-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
@ -78,6 +93,9 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--
Sitemesh, 装饰器Filter
-->
<!-- sitemesh filter-->
<filter>
<filter-name>sitemesh</filter-name>
@ -93,6 +111,9 @@
<mime-type>image/vnd.microsoft.icon</mime-type>
</mime-mapping>
<!--
配置Spring Context 加载配置文件
-->
<!--contextConfigLocation -->
<context-param>
<param-name>contextConfigLocation</param-name>
@ -102,15 +123,26 @@
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.xml</param-value>
</context-param>
<!--
Log4j 日志监听器
-->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!--
Spring Context 监听
-->
<!-- Spring context listener -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--
Spring MVC 配置
-->
<!--mvc-->
<servlet>
<servlet-name>mkk</servlet-name>
@ -127,6 +159,9 @@
<!--<location>/index.jsp</location>-->
<!--</error-page>-->
<!--
配置Session 有效期时间 30分钟
-->
<session-config>
<session-timeout>30</session-timeout>
</session-config>

Loading…
Cancel
Save