Message Converter(메시지 컨버터)
ViewResolver와 MessageConverter 비교
구분
ViewResolver
MessageConverter
HTTP 메시지 컨버터 인터페이스
package org.springframework.http.converter;
public interface HttpMessageConverter<T> {
boolean canRead(Class<?> clazz, @Nullable MediaType mediaType);
boolean canWrite(Class<?> clazz, @Nullable MediaType mediaType);
List<MediaType> getSupportedMediaTypes();
T read(Class<? extends T> clazz, HttpInputMessage inputMessage)
throws IOException, HttpMessageNotReadableException;
void write(T t, @Nullable MediaType contentType, HttpOutputMessage outputMessage)
throws IOException, HttpMessageNotWritableException;
}주요 구현체
구현체
설명
스프링 부트 기본 메시지 컨버터
HTTP 요청 데이터 읽기 및 응답 데이터 생성 과정
Last updated