常规web.xml加载过程详解

原文链接: https://my.oschina.net/u/2609727/blog/776113

show me code




    
    spring
    
    spring example
    
    
    
        
        
        contextConfigLocation
        classpath:spring-mybatis.xml
    
    
    
        encodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        true
        
            encoding
            UTF-8
        
    
    
        encodingFilter
        /*
    
    
    
    
    
        org.springframework.web.context.ContextLoaderListener
    
    
    
        org.springframework.web.util.IntrospectorCleanupListener
    

    
    
        spring
        org.springframework.web.servlet.DispatcherServlet
        
            
            
            contextConfigLocation
            classpath:spring-mvc.xml
        
        
        1
        true
    
    
        spring
        
        
        
        
        /
    
    
    
        /index.jsp
    


总结

当你根据源码点击去的时候比如org.springframework.web.context.ContextLoaderListener,启动调试,你会发现他的加载顺序是context-param>listener>filter>servlet

转载于:https://my.oschina.net/u/2609727/blog/776113

你可能感兴趣的:(常规web.xml加载过程详解)