Spring中的applicationContext.xml實現自動裝配

lonecloud發表於2016-08-06
<?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>

 

相關文章