配置Fastjson解析器

配置Fastjson解析器

配置Fastjson解析器,这里使用注解开发,在springmvc配置文件中添加
阿里巴巴的fastJson,这个号称是目前最快的json解析工具,而且就一个jar包,很方便!
fastjson

  1. <mvc:annotation-driven  >
  2. <mvc:message-converters register-defaults="true">
  3.             <!-- 配置Fastjson支持 -->
  4.             <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
  5.                 <property name="supportedMediaTypes">
  6.                     <list>
  7.                         <value>text/html;charset=UTF-8</value>
  8.                         <value>application/json</value>
  9.                     </list>
  10.                 </property>
  11.                 <property name="features">
  12.                     <list>
  13.                         <value>WriteMapNullValue</value>
  14.                         <value>QuoteFieldNames</value>
  15.                     </list>
  16.                 </property>
  17.             </bean>
  18.         </mvc:message-converters>
  19. </mvc:annotation-driven>
  20.   <!-- 使用注解时一定要配置注解扫描 -->
  21. <context:component-scan base-package="cc.javar.controler" />
腾讯云服务器安全可靠高性能,多种配置供您选择
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: