Spring Boot Controller 에서 전체 파라메터 폼 클래스 유효성 검증
컨트롤러에 WebDataBinder을 이용하여 파라메터로 넘어오는 폼 클래스의 유효성검증을 추가 private final BoradFormValidator boardFormValidator; @InitBinder("boardForm") public void initBinder(WebDataBinder webDataBinder) { webDataBinder.addValidators(boardFormValidator); } 해당 컨트롤러 상단에 선언을 해줍니다. @InitBinder("boardForm") 에서 boardForm의 이름으로 클래스를 찾아서 검증 @GetMapping("/boardDetail") public String detail(Model model, BoardForm boardForm) ..
2023.07.05