springmvc-context.xml 2.0 KB

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