dispatcher.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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" xmlns:mvc="http://www.springframework.org/schema/mvc"
  4. xmlns:task="http://www.springframework.org/schema/task"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  7. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
  8. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
  9. http://www.springframework.org/schema/task
  10. http://www.springframework.org/schema/task/spring-task-3.0.xsd">
  11. <!-- 注解探测器 -->
  12. <mvc:annotation-driven />
  13. <context:component-scan base-package="com.kpt.controller" />
  14. <mvc:interceptors>
  15. <mvc:interceptor>
  16. <mvc:mapping path="/**/*.html" />
  17. <bean class="com.kpt.interceptor.MyInterceptor" />
  18. </mvc:interceptor>
  19. </mvc:interceptors>
  20. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  21. <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
  22. <property name="prefix" value="/" />
  23. <property name="suffix" value=".jsp" />
  24. </bean>
  25. <!-- Spring 上传下载设置 -->
  26. <!-- ========================================== -->
  27. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  28. <property name="defaultEncoding" value="UTF-8" /> <!-- 默认编码 (ISO-8859-1) -->
  29. <property name="maxInMemorySize" value="10240" /> <!-- 最大内存大小 (10240) -->
  30. <property name="maxUploadSize" value="-1" /> <!-- 最大文件大小,-1为无限止(-1) -->
  31. </bean>
  32. <!-- Spring 定时器设置 -->
  33. <bean id="TodoCallService" class="com.kpt.service.impl.TodoCallService" />
  34. <task:scheduled-tasks>
  35. <!--每天凌晨1点运行一次-->
  36. <task:scheduled ref="TodoCallService" method="callGetFeedPriceByDate" cron="0 0 01 * * ?" />
  37. </task:scheduled-tasks>
  38. </beans>