spring-mvc.xml 1.7 KB

123456789101112131415161718192021222324252627282930313233
  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"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xmlns:context="http://www.springframework.org/schema/context"
  8. xsi:schemaLocation="http://www.springframework.org/schema/beans
  9. http://www.springframework.org/schema/beans/spring-beans.xsd
  10. http://www.springframework.org/schema/tx
  11. http://www.springframework.org/schema/tx/spring-tx.xsd
  12. http://www.springframework.org/schema/mvc
  13. http://www.springframework.org/schema/mvc/spring-mvc.xsd
  14. http://www.springframework.org/schema/context
  15. http://www.springframework.org/schema/context/spring-context.xsd">
  16. <mvc:annotation-driven></mvc:annotation-driven>
  17. <context:component-scan base-package="com.fuzamei" />
  18. <!-- 配置事务 -->
  19. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  20. <!-- 加载数据源 -->
  21. <property name="dataSource" ref="dataSource"></property>
  22. </bean>
  23. <!-- 开启事务扫描 -->
  24. <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
  25. <!-- 对token拦截验证 (为方便测试,测试环境给注释掉)-->
  26. <!-- <mvc:interceptors>
  27. <mvc:interceptor>
  28. <mvc:mapping path="/*/api/*" />
  29. <bean class="com.fuzamei.interceptor.TokenInterceptor" />
  30. </mvc:interceptor>
  31. </mvc:interceptors> -->
  32. </beans>