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


    <!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
  • 相关阅读:
    枚举转SelectList扩展方法
    关于Log4Net的使用和配置
    关于Task的认识
    Android Studio 创建不同分辨率的图标
    Android 修改应用图标(Android Studio)
    Android 去除应用标题栏(Android Studio)
    Android Studio 快捷键
    Java 构造器 遇到多个构造器时要考虑用构建器
    Java 构造器 考虑用静态构造方法代替构造器
    Java 深复制和浅复制
  • 原文地址:https://www.cnblogs.com/lshan/p/9179248.html
Copyright © 2020-2023  润新知