dispatcher-servlet.xml 1.4 KB

12345678910111213141516171819202122232425262728293031
  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:context="http://www.springframework.org/schema/context"
  5. xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
  8. <!-- DispatcherServlet Context: defines this servlet's request-processing
  9. infrastructure -->
  10. <context:component-scan base-package="controller" />
  11. <!-- Resolves views selected for rendering by @Controllers to .jsp resources
  12. in the /WEB-INF/views directory -->
  13. <bean
  14. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  15. <property name="prefix" value="/WEB-INF/views/" />
  16. <property name="suffix" value=".jsp" />
  17. </bean>
  18. <bean class = "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
  19. <property name="messageConverters">
  20. <array>
  21. <bean class = "org.springframework.http.converter.StringHttpMessageConverter">
  22. <property name="supportedMediaTypes" value = "text/plain;charset=UTF-8" />
  23. </bean>
  24. </array>
  25. </property>
  26. </bean>
  27. </beans>