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>