fastjson依赖 配置fastjson为默认json转换器


<dependency>

  <groupId>com.alibaba</groupId>

  <artifactId>fastjson</artifactId>

  <version>1.2.38</version>

 </dependency>

 

 

<mvc:annotation-driven>

       <!-- 设置fastjson的转换器对象 -->

       <mvc:message-converters register-defaults="true">

         <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">

            <property name="supportedMediaTypes">

               <list>

                  <value>text/html;charset=utf-8</value>

                  <value>application/json;charset=utf-8</value>

               </list>

            </property>

</bean>

        </mvc:message-converters>

</mvc:annotation-driven>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM