코드 그라데이션
Bean Validation - 소개 본문
Bean Validation - 소개
검증 기능을 지금처럼 매번 코드로 작성하는 것은 상당히 번거롭다.
특히 특정 필드에 대한 검증 로직은 대부분 빈 값인지 아닌지, 특정 크기를 넘는지 아닌지와 같이 매우 일반적인 로직이다.
이런 검증 로직을 모든 프로젝트에 적용할 수 있게 공통화하고, 표준화 한 것이 바로 Bean Validation 이다.
Bean Validation을 잘 활용하면, 애노테이션 하나로 검증 로직을 매우 편리하게 적용할 수 있다.
하이버네이트 Validator 관련 링크
공식 사이트: http://hibernate.org/validator/
공식 메뉴얼: https://docs.jboss.org/hibernate/validator/6.2/reference/en-US/html_single/
검증 애노테이션 모음: https://docs.jboss.org/hibernate/validator/6.2/reference/en-US/html_single/#validator-defineconstraints-spec
728x90
'Spring > Validation' 카테고리의 다른 글
Bean Validation - 스프링 적용 (0) | 2024.03.02 |
---|---|
Bean Validation - 시작 및 프로젝트 세팅 V3 (1) | 2024.03.01 |
Validator 분리 (2) (0) | 2024.02.28 |
Validator 분리 (1) (0) | 2024.02.28 |
오류 코드와 메시지 처리 (6) (0) | 2024.02.27 |
Comments