context-dispatcher.xml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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
  17. base-package="com.hssx" />
  18. <!-- 通过注解,把URL映射到Controller上,该标签默认注册DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter -->
  19. <!-- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"
  20. /> -->
  21. <mvc:annotation-driven />
  22. <!-- 视图解析器 -->
  23. <bean id="viewResolver"
  24. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  25. <property name="viewClass"
  26. value="org.springframework.web.servlet.view.JstlView" />
  27. <property name="prefix" value="/view/" />
  28. <property name="suffix" value=".jsp"></property>
  29. </bean>
  30. <bean id="multipartResolver"
  31. class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
  32. p:defaultEncoding="UTF-8">
  33. <property name="maxUploadSize" value="10000000" /><!-- 10M -->
  34. </bean>
  35. </beans>