Spring的web.xml文件配置

2020-12-13 02:25

阅读:294

标签:定义   容器   全局   context   分发   org   init   filter   prefix   

 
    context-param> 
        param-name>contextConfigLocationparam-name>  
        
        param-value>classpath:spring/spring-base.xmlparam-value>
    context-param>
    
    listener>
        listener-class>
            org.springframework.web.context.ContextLoaderListener
        listener-class>
    listener>
    
    servlet>
        servlet-name>SpringMVCServletservlet-name>
        servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        servlet-class>
        
        init-param>
            param-name>contextConfigLocationparam-name>
            param-value>classpath:spring/spring-mvc.xmlparam-value>
        init-param>
    servlet>
    servlet-mapping>
        servlet-name>SpringMVCServletservlet-name>
        url-pattern>*.actionurl-pattern> 
    servlet-mapping>
    
    filter>
        filter-name>EncodingFitlerfilter-name>
        filter-class>
                org.springframework.web.filter.CharacterEncodingFilter
        filter-class>
        init-param>
            param-name>encodingparam-name>
            param-value>UTF-8param-value>
        init-param>
    filter>
    filter-mapping>
        filter-name>EncodingFitlerfilter-name>
        url-pattern>/*url-pattern>
    filter-mapping>
配置action扫描路径

   
   
   
   

 

 

 

 

Spring的web.xml文件配置

标签:定义   容器   全局   context   分发   org   init   filter   prefix   

原文地址:https://www.cnblogs.com/fcitx/p/11037549.html


评论


亲,登录后才可以留言!