码迷,mamicode.com
首页 > 编程语言 > 详细

Spring 配置 web.xml (防止spring 内存溢出)

时间:2018-06-13 19:36:29      阅读:337      评论:0      收藏:0      [点我收藏+]

标签:list   domain   log4   proxy   loader   message   ati   img   desc   

技术分享图片
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        /WEB-INF/classes/spring/spring-context.xml
        /WEB-INF/classes/spring/spring-security.xml
        </param-value>
        <description>contextConfigLocation configuration</description>
    </context-param>
    
    
    <context-param>
        <param-name>spring.profiles.active</param-name>
        <param-value>dev</param-value>
    </context-param>
    <context-param>
        <param-name>spring.profiles.default</param-name>
        <param-value>dev</param-value>
    </context-param>
    <context-param>
        <param-name>spring.liveBeansView.mbeanDomain</param-name>
        <param-value>dev</param-value>
    </context-param> 
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- 防止spring内存溢出监听器 -->
    <listener>
        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
    </listener>
    <!-- spring mvc servlet -->
    <servlet>
        <servlet-name>springMvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/classes/spring/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springMvc</servlet-name>
        <url-pattern>/ws/*</url-pattern>
    </servlet-mapping>
    
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    
    <!-- <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener> -->
    <!-- life,20171122,add MDC Filter. -->
    <!-- MDC Filter. It‘s used to put request message to MDC and later can get the request body content from MDC -->
    <filter>
        <filter-name>mdcInMessageFilter</filter-name>
        <filter-class>com.icil.edi.ws.common.filter.MDCInMessageFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>mdcInMessageFilter</filter-name>
        <url-pattern>/ws/*</url-pattern>
    </filter-mapping>
    <!-- load the log4j configure file -->
    <listener>   
         <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>  
    </listener>  
    <context-param>   
        <param-name>log4jConfigLocation</param-name>   
        <param-value>/WEB-INF/classes/log/log4j.properties</param-value>  
    </context-param> 

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>
View Code

 

Spring 配置 web.xml (防止spring 内存溢出)

标签:list   domain   log4   proxy   loader   message   ati   img   desc   

原文地址:https://www.cnblogs.com/lshan/p/9179248.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!