dispatcher-servlet.xml 1.4 KB

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