Spring与Mabatis整合 IOC成功的配置

context-common.spring.xml:

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
       http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"
       default-autowire="byName">

    
    

    
    
          class="org.apache.commons.dbcp.BasicDataSource">
        
        
        
        
          
          
          
          
          
          
          
          
          
         
        
    

    
    
    
    
        
        
                      expression="execution(* testwebapp.com.wangzuojia.service..*.*(..))" />
        
        
    
    
    
        
        
            
            
            
            
            
            
        
    

    
    
        
    

    
    

    
        
    

    
    
        
        
        
            
                classpath*:testwebapp/com/wangzuojia/mapping/*.xml
            
        
        
    

    
        
        
    

    
        
    


mybatis-config.xml:

"http://mybatis.org/dtd/mybatis-3-config.dtd">
    
        
        
    

    
        
    

Spring与Mabatis整合结束


applicationContext.xml:

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
       http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">

     
     
    


web.xml:

 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 " http://java.sun.com/dtd/web-app_2_3.dtd" >

  Archetype Created Web Application

   
    
       contextConfigLocation
       classpath*:applicationContext.xml
    

      
    
          org.springframework.web.context.ContextLoaderListener
    

       
    
        org.springframework.web.util.IntrospectorCleanupListener
    

你可能感兴趣的:(Spring,spring,ioc,aop)