context-dispatcher.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans default-lazy-init="true"
  3. xmlns="http://www.springframework.org/schema/beans"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xmlns:context="http://www.springframework.org/schema/context"
  7. xmlns:mvc="http://www.springframework.org/schema/mvc"
  8. xsi:schemaLocation="
  9. http://www.springframework.org/schema/beans
  10. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  11. http://www.springframework.org/schema/mvc
  12. http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
  13. http://www.springframework.org/schema/context
  14. http://www.springframework.org/schema/context/spring-context-3.0.xsd">
  15. <!-- 使用注解的包,包括子集 -->
  16. <context:component-scan base-package="com.js.kbt" />
  17. <!-- 通过注解,把URL映射到Controller上,该标签默认注册DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter -->
  18. <!-- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> -->
  19. <mvc:annotation-driven />
  20. <!-- 视图解析器 -->
  21. <bean id="viewResolver"
  22. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  23. <property name="viewClass"
  24. value="org.springframework.web.servlet.view.JstlView" />
  25. <property name="prefix" value="/pages/" />
  26. <property name="suffix" value=".jsp"></property>
  27. </bean>
  28. <bean id="multipartResolver"
  29. class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
  30. p:defaultEncoding="UTF-8" >
  31. <property name="maxUploadSize" value="10000000" /><!-- 10M -->
  32. </bean>
  33. </beans>