SSM框架集成步骤

1、创建maven项目,导入jar包

  
            org.aspectj
            aspectjweaver
            1.6.8
        
        
            org.springframework
            spring-web
            5.2.5.RELEASE
        
        
            org.springframework
            spring-webmvc
            5.2.5.RELEASE
        
        
            org.springframework
            spring-tx
            5.2.5.RELEASE
        
        
            org.springframework
            spring-jdbc
            5.2.5.RELEASE
        
        
            com.alibaba
            druid
            1.1.20
        
        
            com.github.pagehelper
            pagehelper
            5.1.2
        
        
            mysql
            mysql-connector-java
            ${mysql.version}
        
        
            org.mybatis
            mybatis
            ${mybatis.version}
        
        
            org.mybatis
            mybatis-spring
            1.3.0
        
        
        
            log4j
            log4j
            ${log4j.version}
        
        
            org.slf4j
            slf4j-api
            ${slf4j.version}
        
        
            org.slf4j
            slf4j-log4j12
            ${slf4j.version}
        
        
        
            com.fasterxml.jackson.core
            jackson-databind
            2.9.0
        
        
            com.fasterxml.jackson.core
            jackson-core
            2.9.0
        
        
            com.fasterxml.jackson.core
            jackson-annotations
            2.9.0
        
        
            org.projectlombok
            lombok
            1.18.8
            provided
        
        
        
            io.springfox
            springfox-swagger2
            2.9.2
        
        
            io.springfox
            springfox-swagger-ui
            2.9.2
        
        
            com.github.xiaoymin
            swagger-bootstrap-ui
            1.9.3
        
        
            io.springfox
            springfox-bean-validators
            2.9.2
        
        
        
            io.swagger
            swagger-annotations
            1.5.22
        
        
            io.swagger
            swagger-models
            1.5.22
        

2、配置web.xml

 





    
        contextConfigLocation
        classpath:app-context.xml
    

    
        org.springframework.web.context.ContextLoaderListener
    

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

    
        encodingFilter
        /*
    

    
        dispatcherServlet
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath:app-context-mvc.xml
        
        1
    

    
        dispatcherServlet
        /
    



3、简单配置app-context-mvc.xml




    

    
        
    

    
        
        
    


4、配置app-context.xml






    
        
    

    

    
        
        
        
        

        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    

    
    
        
        
        
        
        
        
            
                
                
                    
                        
                            
                            mysql
                            
                            true
                        
                    
                
            
        
    

    
    
        
    


    
        
    


    
        
        
    


    
        
            
        
    

    
    


    
    


 源码地址:https://github.com/Fish-CC/ssmProject

你可能感兴趣的:(java)