spring 注解

来源:互联网 发布:软件平台开发流程 编辑:程序博客网 时间:2024/05/17 03:07
<!-- 启用注解 -->

<context:annotation-config />


<!-- 扫描位置 -->

<context:component-scan base-package="com.csh.project" />  该注解包含了第一个注解的功能,使用该注解就无需使用第一个注解了。



<context:component-scan base-package="com.n22.tawm">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>

applicationContext.xml 加载   exclude(除了control都扫描)


 <context:property-placeholder
ignore-unresolvable="true"
location="classpath:jdbc.properties,classpath:application.properties,classpath:testservice.properties" />

扫描classpath路径下面的文件,通过${}可以直接使用。   ignore-unresolvable="true"可以加载多个文件



0 0
原创粉丝点击