Bootstrap

Spring的xml文档配置

1基于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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--把对象的创建交给spring来管理-->
    <bean id="accountService" class="com.itheima.service.impl.AccountServiceImpl"
         scope="" init-method="" destroy-method=""   >
             <property name="" value/ref=""></property>
         </bean>
</beans>

2注解的context名称空间

<?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.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">

    <!--告知spring在创建容器时要扫描的包,配置所需要的标签不是在beans的约束中,而是一个名称为
    context名称空间和约束中-->
    <context:component-scan base-package="com.itheima"></context:component-scan>
</beans>

base-package属性,指定了spring要扫描的包及其子包的所有类的注解

3spring框架中XML文件头部常用配置

spring框架的xml配置文件头部和springmvc的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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd">

</beans>

context配置:扫描注解

xmlns:context="http://www.springframework.org/schema/context"
		http://www.springframework.org/schema/context
		https://www.springframework.org/schema/context/spring-context.xsd

AOP配置:切面约束

xmlns:aop="http://www.springframework.org/schema/aop"
       http://www.sp
;