[jersey]用FastJson替换掉默认的Jackson
发布时间:2020-12-16 18:41:59 所属栏目:百科 来源:网络整理
导读:@Bean public ResourceConfig resourceConfig() { ResourceConfig resourceConfig = new ResourceConfig(); // 用FastJson替换掉默认的Jackson resourceConfig.register(FastJsonResolver. class ); resourceConfig.register(FastJsonFeature. class ); retu
@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; } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |