applicationContext.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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:context="http://www.springframework.org/schema/context"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xmlns:aop="http://www.springframework.org/schema/aop"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-2.5.xsd
  11. http://www.springframework.org/schema/tx
  12. http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
  13. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
  14. <context:component-scan base-package = "oa.controller" >
  15. <context:exclude-filter type = "annotation"
  16. expression = "org.springframework.stereotype.Service" />
  17. </context:component-scan >
  18. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
  19. <property name="messageConverters">
  20. <list>
  21. <ref bean="jsonHttpMessageConverter" />
  22. </list>
  23. </property>
  24. </bean>
  25. <bean id="jsonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
  26. <property name="supportedMediaTypes">
  27. <list>
  28. <value>application/json;charset=UTF-8</value>
  29. </list>
  30. </property>
  31. </bean>
  32. <bean id="loginAspectBean" class="com.filter.LoginInterceptor" />
  33. <aop:config>
  34. <aop:aspect id="loginAspect" ref="loginAspectBean">
  35. <aop:pointcut id="businessService"
  36. expression="execution(* (oa.controller.BaseAction+).*_login(..))" />
  37. <aop:before pointcut-ref="businessService" method="doBefore"/>
  38. </aop:aspect>
  39. </aop:config>
  40. </beans>