1.基本组件管理需要的jar包

commons-logging.jar,spring.jar

xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"       
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> 

 

2.Aopjar包和 xml配置

jar:

 aspectjweaver.jar aspectjrt.jar cglib-nodep-2.1_3.jar

xml: 

 <?xml version="1.0" encoding="UTF-8"?>

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

 

3. 完整配置

 <?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context
="http://www.springframework.org/schema/context" 
       xmlns:aop
="http://www.springframework.org/schema/aop"      
       xsi:schemaLocation
="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
>
     
    <!-- 注解方式--> 
    <!--    
    <context:annotation-config/>
    <bean >>
 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2021-12-02
  • 2021-10-27
  • 2021-07-05
  • 2022-02-08
  • 2021-08-11
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-06-30
  • 2022-12-23
相关资源
相似解决方案