Spring的Annotation

<?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"<!--找到带有context的命名空间的beans,这样才会有语句提示-->
    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的Annotation支持-->
    <context:annotation-config/>
    <!--设定Spring去哪些包中找Annotation-->
    <context:component-scan base-package="org.example"/>
    
</beans>

 

posted @ 2015-11-08 17:21  Akke  阅读(207)  评论(0编辑  收藏  举报