spring-application.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
  5. xmlns:cache="http://www.springframework.org/schema/cache"
  6. xmlns:context="http://www.springframework.org/schema/context"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  9. http://www.springframework.org/schema/tx
  10. http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
  11. http://www.springframework.org/schema/aop
  12. http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
  13. http://www.springframework.org/schema/util
  14. http://www.springframework.org/schema/util/spring-util-4.0.xsd
  15. http://www.springframework.org/schema/cache
  16. http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
  17. http://www.springframework.org/schema/context
  18. http://www.springframework.org/schema/context/spring-context-4.0.xsd">
  19. <!-- 使用annotation自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
  20. <context:component-scan base-package="com.e3.zl.wc">
  21. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  22. <context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice"/>
  23. </context:component-scan>
  24. <!-- 将配置文件读取到容器中,交给Spring管理 -->
  25. <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  26. <property name="locations">
  27. <list>
  28. <!-- 这里支持多种寻址方式:classpath和file -->
  29. <value>classpath:config/jdbc.properties</value>
  30. </list>
  31. </property>
  32. </bean>
  33. <!-- mybatis -->
  34. <import resource="classpath:config/spring-mybatis.xml" />
  35. </beans>