springmvc-context.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <description>Spring-web MVC配置</description>
  21. <mvc:annotation-driven />
  22. <context:component-scan base-package="com.xxl.controller" />
  23. <mvc:resources mapping="/favicon.ico" location="/favicon.ico" />
  24. <mvc:resources mapping="/static/**" location="/static/" />
  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="" /> <!-- 模板前后缀,指定html页面为模板 -->
  28. <property name="suffix" value=".ftl" />
  29. <property name="contentType" value="text/html;charset=UTF-8" /> <!-- 模板输出内容编码 (此处应与defaultEncoding保持一致) -->
  30. <property name="exposeSpringMacroHelpers" value="true" /> <!-- 访问Request/Session宏助手 -->
  31. <property name="exposeRequestAttributes" value="true" /> <!-- 允许访问Request属性,默认为false -->
  32. <property name="exposeSessionAttributes" value="true" /> <!-- 允许访问Session属性,默认为false -->
  33. <property name="requestContextAttribute" value="request" /> <!-- 将HttpServletRequest的属性存放到request这个变量中 -->
  34. <property name="cache" value="true" />
  35. <property name="order" value="0" />
  36. </bean>
  37. <!-- <mvc:interceptors>
  38. <mvc:interceptor>
  39. <mvc:mapping path="/**"/>
  40. <bean class="com.xxl.controller.interceptor.PermissionInterceptor"/>
  41. </mvc:interceptor>
  42. </mvc:interceptors>
  43. <bean id="exceptionResolver" class="com.xxl.controller.resolver.WebExceptionResolver" /> -->
  44. </beans>