maven配置SpringMVC



1.配置pom.xml



    org.springframework
    spring-webmvc
    5.3.18




    javax.servlet
    javax.servlet-api
    4.0.1
    provided

2.main文件夹下新建resources目录
3.resources目录下新建ApplictionContext.xml

<?xml version="1.0" encoding="UTF-8"?>

    

4.resources目录下新建springmvc.xml





    
    
    
    

5.配置web.xml




    
        index.html
        index.htm
        index.jsp
        default.html
        default.htm
        default.jsp
    

    
    
        SpringMVC
        org.springframework.web.servlet.DispatcherServlet
        
        
            contextConfigLocation
            classpath:springmvc.xml
        
        
        1
    
    
        SpringMVC
        /
    
    
    
        contextConfigLocation
        classpath:applicationContext.xml
    
    
    
        org.springframework.web.context.ContextLoaderListener
    

    
    
    
        encodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
        
            forceEncoding
            true
        
    
    
        encodingFilter
        /*
    

6.下载tomcathttps://tomcat.apache.org/download-90.cgi

7.利用tomcat运行Spring MVC

8.添加配置




9。这个时候你就能看到tomcat的图标了

启动发现报错,修复乱码