SSM框架(一)-web.xml文件配置

一、web.xml加载过程

当我们启动一个WEB项目容器时,容器包括(JBoss,Tomcat等)。首先会去读取web.xml配置文件里的配置,当这一步骤没有出错并且完成之后,项目才能正常的被启动起来。

启动WEB项目的时候,容器首先会去读取web.xml配置文件中的两个节点:

详细的介绍就不在这里赘述了,传送门:open

SSM框架(一)-web.xml文件配置_第1张图片

具体的web.xml代码



    
        /Login.net
    
    
        404
        /Error.net
    
    
    
        org.springframework.web.context.ContextLoaderListener
    
    
    
        contextConfigLocation
        classpath*:spring.xml
    

    
    
        webAppRootKey
        rootPath
    
    
        org.springframework.web.util.WebAppRootListener
    

    
    
        600
    

    
    
        CharacterEncodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            utf-8
        
    
    
        CharacterEncodingFilter
        /*
    
    
    
        springmvc
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath:springmvc.xml
        
    
    
    
        springmvc
        *.in
    
    
        springmvc
        *.net
    
    
        springmvc
        /
    

 

 

 

你可能感兴趣的:(Java,SSM)