jersey 用FastJson替换掉默认的Jackson

    @Bean
public ResourceConfig resourceConfig() {
ResourceConfig resourceConfig = new ResourceConfig(); // 用FastJson替换掉默认的Jackson
resourceConfig.register(FastJsonResolver.class);
resourceConfig.register(FastJsonFeature.class); return resourceConfig;
} @Provider
static class FastJsonResolver implements ContextResolver<FastJsonConfig> {
// 用FastJson替换掉默认的Jackson
public FastJsonConfig getContext(Class<?> type) {
FastJsonConfig fastJsonConfig = new FastJsonConfig();
return fastJsonConfig;
} }
上一篇:docker搭建redis主从集群和sentinel哨兵集群,springboot客户端连接


下一篇:带你读《重构数字战斗力: 中小企业的数字化转型之路》第二章电子电气企业覆盖 “全渠道—研发—经营—制造” 全价值链的上云之路案例6(二)