spring整合mybatis依赖

pom.xml文件


    
      junit
      junit
      4.11
      test
    
    
      org.springframework
      spring-context
      5.3.17
    
    
    
      org.springframework
      spring-tx
      5.3.17
    
    
      org.springframework
      spring-jdbc
      5.3.17
    
    
    
      org.mybatis
      mybatis
      3.5.9
    
    
    
      org.mybatis
      mybatis-spring
      2.0.7
    
    
    
      mysql
      mysql-connector-java
      5.1.49
    
    
    
      com.alibaba
      druid
      1.2.8
    
  


  
    
      
        src/main/java
        
          **/*.properties
          **/*.xml
        
        false
      
      
        src/main/resources
        
          **/*.properties
          **/*.xml
        
        false
      
      
        src/main/resources
        
          **/*.xml
          **/*.properties
        
      
    
  

spring主配置文件(applicationContext.xml)


    
    
        
        
        
        
    
    
    
        
        
        
        
    
    
        
        
        
    

mybatis主配置文件





    
        
    

    
    
        
        
    

    
        
        
        
        
    

mapper配置文件






    

    
        
        
    

web.xml中创建监听器对象


        contextConfigLocation
        classpath:applicationContext.xml
    
    
        
            org.springframework.web.context.ContextLoaderListener
        
    

你可能感兴趣的:(java,java-ee)