springmvc-config.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-4.3.xsd
  11. http://www.springframework.org/schema/mvc
  12. http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
  13. <context:component-scan base-package="controller"/>
  14. <bean id="jspViewResover" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  15. <property name="prefix" value="/WEB-INF/jsp/"/>
  16. <property name="suffix" value=".jsp"/>
  17. </bean>
  18. <!-- 配置注解驱动 -->
  19. <mvc:annotation-driven/>
  20. <mvc:default-servlet-handler/>
  21. <!-- 处理静态资源 -->
  22. <bean id="multipartResolver"
  23. class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  24. <!-- 设置请求编码格式 -->
  25. <property name="defaultEncoding" value="UTF-8"/>
  26. </bean>
  27. </beans>