通过@Produces注解例如:

package com.wzh.app.beans;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import javax.enterprise.inject.Produces;

public class InitBean {

    @Produces
    public ObjectMapper objectMapper() {
        return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
    }
}

 

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2021-12-03
  • 2022-01-01
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
猜你喜欢
  • 2022-01-01
  • 2022-01-01
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-02-12
相关资源
相似解决方案