@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;
        }

    }

 

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2021-08-29
  • 2021-08-09
  • 2022-12-23
  • 2021-11-08
  • 2022-02-12
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案