springmvc-context.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:aop="http://www.springframework.org/schema/aop"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:p="http://www.springframework.org/schema/p"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:mvc="http://www.springframework.org/schema/mvc"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:schemaLocation="
  10. http://www.springframework.org/schema/beans
  11. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  12. http://www.springframework.org/schema/context
  13. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  14. http://www.springframework.org/schema/aop
  15. http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
  16. http://www.springframework.org/schema/tx
  17. http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
  18. http://www.springframework.org/schema/mvc
  19. http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
  20. <mvc:annotation-driven />
  21. <context:component-scan base-package="com.dianping.job.controller" />
  22. <mvc:resources mapping="/favicon.ico" location="/favicon.ico" />
  23. <mvc:resources mapping="/static/**" location="/static/" />
  24. <mvc:resources mapping="/**/*.html" location="/" />
  25. <bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
  26. <property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView" />
  27. <property name="prefix" value="" />
  28. <property name="suffix" value=".ftl" />
  29. <property name="contentType" value="text/html;charset=UTF-8" />
  30. <property name="exposeSpringMacroHelpers" value="true" />
  31. <property name="exposeRequestAttributes" value="true" />
  32. <property name="exposeSessionAttributes" value="true" />
  33. <property name="requestContextAttribute" value="request" />
  34. <property name="cache" value="true" />
  35. <property name="order" value="0" />
  36. </bean>
  37. <!--
  38. // 自定义拦截器,支持SSO登陆拦截
  39. <mvc:interceptors>
  40. <mvc:interceptor>
  41. <mvc:mapping path="/**"/>
  42. <bean class="com.xxl.controller.interceptor.PermissionInterceptor"/>
  43. </mvc:interceptor>
  44. </mvc:interceptors>
  45. <bean id="exceptionResolver" class="com.xxl.controller.resolver.WebExceptionResolver" />
  46. -->
  47. </beans>