나는 방금 maven에 jackson 종속성을 추가했으며 더 이상 아무것도 추가하지 않고 추가 코드 구성없이 마샬링에 사용하기 시작했습니다. 스프링은 직렬화에 jackson을 사용하는 방법을 어떻게 알고 있습니까?
짧은 대답-클래스 경로에있는 경우.
더 긴 대답-
사용 @EnableWebMvc
하는 경우 사용 하는 WebMvcConfigurationSupport 를 확장 하는 DelegatingWebMvcConfiguration 을 호출 합니다.
private static final boolean jackson2Present =
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", WebMvcConfigurationSupport.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator", WebMvcConfigurationSupport.class.getClassLoader());
Jackson이 클래스 경로에 있는지 확인합니다. 이 부울은 다음을 포함한 다양한 장소에서 사용됩니다.addDefaultHttpMessageConverters
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다