dispatcher.xml 1.2 KB

1234567891011121314151617181920212223
  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 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  7. <!--扫描组件-->
  8. <context:component-scan base-package="com.demo.wjj.controller"/>
  9. <context:component-scan base-package="com.demo.wjj.validator"/>
  10. <context:component-scan base-package="com.demo.wjj.converter"/>
  11. <mvc:annotation-driven>
  12. <mvc:message-converters>
  13. <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
  14. <property name="supportedMediaTypes" value="application/json;charset=utf-8"/>
  15. </bean>
  16. </mvc:message-converters>
  17. </mvc:annotation-driven>
  18. <mvc:default-servlet-handler/>
  19. </beans>