SSMは必要な設定ファイルを開発するためのサービス層のフレームワークを使用します(applicationContext.xmlを)

<?xml version = "1.0"エンコード= "UTF-8"?> 
<豆のxmlns = "http://www.springframework.org/schema/beans" 
       のxmlns:XSI = "http://www.w3.org / 2001 / XMLスキーマ・インスタンス" 
       のxmlns:コンテキスト= "http://www.springframework.org/schema/context"のxmlns:TX = "http://www.springframework.org/schema/tx" 
       のxmlns:AOP =" http://www.springframework.org/schema/aop」 
       XSI:のschemaLocation =" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans。 XSD http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/txます。http:// www.springframework.org/schema/tx/spring-tx.xsdます。http://www.springframework。ORG /スキーマ/ AOP http://www.springframework.org/schema/aop/spring-aop.xsd ">
        <! -扫描包- > 
        <コンテキスト:コンポーネント・スキャンベースパッケージ= "cn.kgc.service"> </コンテキスト:コンポーネント・スキャン> 
        < ! -引入数据源- > 
        <輸入資源= "クラスパス:application_dao.xml"> </インポート> 
        <! -创建SqlSessionFactory对象- > 
        <豆ID =」工場"クラス=" org.mybatis.spring.SqlSessionFactoryBean「> 
            <! -注入データソース- >
            <プロパティ名= "データソース" REF = "データソース"> </ property>の
        </豆> 
        <! -映射文件包扫描- > 
        <beanクラス= "org.mybatis.spring.mapper.MapperScannerConfigurer"> 
            <プロパティ名前= "basePackage"値= "cn.kgc.dao"> </ property>の
        </豆> 

        <! -创建事物管理器对象- > 
        <豆ID = "のTransactionManager"クラス= "org.springframework.jdbc .datasource.DataSourceTransactionManager "> 
            <! -注入数据源- > 
            <プロパティ名="データソース"REF = "データソース"> </ property>の
        </豆>  
        <! -设置通知- >
        <TX:アドバイスID ="アドバイス」トランザクション・マネージャー= "のTransactionManager"> 
            <TX:属性> 
                <TX:メソッド名= "*見つける"読み取り専用= "true"を伝播= "SUPPORTS" /> 
                <TX:メソッド名= "クエリ* "読み取り専用=" true」を伝播= "SUPPORTS" /> 
                <TX:メソッド名= "取得*"読み取り専用= "true"の伝播を= "をサポート" /> 
                <TX:メソッド名= "*"読み取りをのみ= "false"を伝播= "REQUIRED" /> 
            </ TX:>属性
        </ TX:アドバイス> 
        <! -配置切面- > 
        <AOP:config>の
            <AOP:顧問のアドバイス-REF = "アドバイス"ポイントカット= "実行(* cn.kgc.service.impl * *(..)。。)"> </ AOP:顧問> 
        </ AOP:config>の
</豆>

  

おすすめ

転載: www.cnblogs.com/Hubert-dzl/p/11456966.html