Spring4+SpringMVC+MyBatis3整合测试

标签(空格分隔): Java框架


版本号

Spring:4.3.5.RELEASE
MyBatis:3.4.1

项目架构

Spring4+SpringMVC+MyBatis3整合测试_第1张图片
屏幕快照 2017-03-04 上午10.08.05.png-51kB

jar包

  1. Spring

    Spring4+SpringMVC+MyBatis3整合测试_第2张图片
    屏幕快照 2017-03-04 上午10.13.27.png-47.1kB

  2. MyBatis

    屏幕快照 2017-03-04 上午10.15.23.png-12kB
    屏幕快照 2017-03-04 上午10.15.23.png-12kB

  3. 其他

    Spring4+SpringMVC+MyBatis3整合测试_第3张图片
    屏幕快照 2017-03-04 上午10.16.18.png-32.2kB

    屏幕快照 2017-03-04 上午10.17.07.png-12.1kB
    屏幕快照 2017-03-04 上午10.17.07.png-12.1kB

  4. 所有26个jar包

    Spring4+SpringMVC+MyBatis3整合测试_第4张图片
    屏幕快照 2017-03-04 上午10.17.57.png-96.3kB

Maven:pom.xml配置


    4.0.0
    com.javen.maven01
    maven01
    war
    0.0.1-SNAPSHOT
    maven01 Maven Webapp
    http://maven.apache.org

    
        
        4.3.5.RELEASE
        
        3.4.1
        
        1.2.17
    

    

        
        
            junit
            junit
            4.11
            
            test
        


        
        
            org.mybatis
            mybatis
            ${mybatis.version}
        


        
        
            org.mybatis
            mybatis-spring
            1.3.1
        

        
        
            mysql
            mysql-connector-java
            5.1.39
        

        
        
            c3p0
            c3p0
            0.9.1.2
        

        
        
        
            log4j
            log4j
            ${log4j.version}
        

        
        
        
            javax.servlet.jsp.jstl
            javax.servlet.jsp.jstl-api
            1.2.1
        


        
        
        
            commons-logging
            commons-logging
            1.1.1
        

        
        
            commons-io
            commons-io
            2.4
        

        
        
            org.apache.commons
            commons-lang3
            3.4
        


        
        
            org.aspectj
            aspectjweaver
            1.8.10
        


        
        
        
            javax.servlet
            javax.servlet-api
            3.1.0
        

        
        
            javax.servlet.jsp
            javax.servlet.jsp-api
            2.3.1
        


        
        
            org.springframework
            spring-core
            ${spring.version}
        

        
            org.springframework
            spring-context
            ${spring.version}
        

        
            org.springframework
            spring-web
            ${spring.version}
        

        
            org.springframework
            spring-test
            ${spring.version}
        

        
            org.springframework
            spring-beans
            ${spring.version}
        

        
            org.springframework
            spring-web
            ${spring.version}
        

        
            org.springframework
            spring-webmvc
            ${spring.version}
        

        
            org.springframework
            spring-jdbc
            ${spring.version}
        

        
            org.springframework
            spring-aop
            ${spring.version}
        


        
            org.springframework
            spring-tx
            ${spring.version}
        

        
            org.springframework
            spring-orm
            ${spring.version}
        

        
            org.springframework
            spring-context-support
            ${spring.version}
        
    

    
        maven01
        
            
                org.eclipse.jetty
                jetty-maven-plugin
                9.2.8.v20150217
                
                    
                        80
                    
                    shutdown
                    9966
                
            
        
    



配置文件

web.xml



    SSM
    
        index.jsp
    

    
    
        contextConfigLocation
        classpath:applicationContext.xml
    


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


    
    
        org.springframework.web.context.ContextLoaderListener
    



    
    
        springMVC
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath:spring-mvc.xml
        
        1
    
    
        springMVC
        *.do
    

applicationContext.xml




    
    
    

    
    
        
        
        
        
    

    
    
        
        
        
        
        
    

    
    
        
        
    

    
    
        
    

    
    
        
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
        
    

    
    
        
        
    


spring-mvc.xml




    
    

    
    
        
        
    

  

mybatis-config.xml




    
    
        
    


log4j.xml

log4j.rootLogger=debug,appender1,appender2

log4j.appender.appender1=org.apache.log4j.ConsoleAppender 

log4j.appender.appender2=org.apache.log4j.FileAppender 
log4j.appender.appender2.File=C:/logFile.txt
 
log4j.appender.appender1.layout=org.apache.log4j.TTCCLayout
log4j.appender.appender2.layout=org.apache.log4j.TTCCLayout  

简单的登录测试

GitHub

你可能感兴趣的:(Spring4+SpringMVC+MyBatis3整合测试)