spring-servlet.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <beans
  2. xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="
  7. http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  11. http://www.springframework.org/schema/mvc
  12. http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  13. <context:component-scan base-package="com.yihu.jk.action" />
  14. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  15. <property
  16. name="prefix"
  17. value="/WEB-INF/jsp/" />
  18. <property
  19. name="suffix"
  20. value=".jsp" />
  21. </bean>
  22. <mvc:annotation-driven>
  23. <mvc:message-converters register-defaults="true">
  24. <bean class="org.springframework.http.converter.StringHttpMessageConverter">
  25. <constructor-arg value="UTF-8"/>
  26. </bean>
  27. </mvc:message-converters>
  28. </mvc:annotation-driven>
  29. <!-- SpringMVC上传文件时,需要配置MultipartResolver处理器 -->
  30. <bean id="multipartResolver"
  31. class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  32. <property name="defaultEncoding" value="UTF-8" />
  33. <!-- 指定所上传文件的总大小,单位字节。注意maxUploadSize属性的限制不是针对单个文件,而是所有文件的容量之和 -->
  34. <property name="maxUploadSize" value="10240000" />
  35. </bean>
  36. </beans>