개발 공부
Exception class의 ResponseStatus 사용 본문
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
With {@code HttpServletResponse.sendError}, the response is considered
complete and should not be written to any further. Furthermore, the Servlet
container will typically write an HTML error page therefore making the
use of a {@code reason} unsuitable for REST APIs. For such cases it is
preferable to use a {@link org.springframework.http.ResponseEntity} as
a return type and avoid the use of {@code @ResponseStatus} altogether.
'웹개발 (자바, 스프링, React) > 웹개발' 카테고리의 다른 글
soft delete를 위한 auditing (0) | 2021.06.18 |
---|---|
랜덤 알파벳 생성 (0) | 2021.06.18 |
타임리프 자바스크립트 사용하기, 데이터 내보내기 (0) | 2021.01.06 |
자바 개발 참고 (0) | 2021.01.06 |
잡다한 기술 (0) | 2021.01.06 |
Comments