Spring中的applicationContext.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">
	<!-- 要进行自动主键扫描的话需要加入xmlns:context="http://www.springframework.org/schema/context" -->
	<!-- 	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-2.5.xsd -->
	<!-- Springs实现自动装配的Base-package的报下的目录 -->
	<context:component-scan base-package="cn.lonecloud.pagekageauto"></context:component-scan>

</beans>

 

posted @ 2016-08-06 11:51  lonecloud  阅读(525)  评论(0编辑  收藏  举报
我的博客即将同步至 OSCHINA 社区,这是我的 OSCHINA ID:lonecloud,邀请大家一同入驻:https://www.oschina.net/sharing-plan/apply