1. 程式人生 > >SpringMVC 手動配置Bean和自動註冊Bean

SpringMVC 手動配置Bean和自動註冊Bean

複製程式碼
<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"
> <context:component-scan base-package="com.lei" > <context:include-filter type="regex" expression="com.lei.customer.dao.*DAO.*" /> <context:include-filter type="regex" expression="com.lei.customer.services.*Service.*"
/> </context:component-scan> </beans>
複製程式碼