@PostMapping("/add") public String addItemV4(@ModelAttribute Item item, BindingResult bindingResult, RedirectAttributes redirectAttributes, Model model) { //주의할 점은 BindingResult는 @ModelAttribute를 붙인 오브젝트 뒤에 오는 것으로 순서가 중요하다. //필드 검증 log.info("objectName = {}", bindingResult.getObjectName()); log.info("object = {}", bindingResult.getTarget()); //item.toString 사용 // 로그를 돌려보면 //objectName = item //o..
@PostMapping("/add") public String addItem(@ModelAttribute Item item, BindingResult bindingResult, RedirectAttributes redirectAttributes, Model model) { //주의할 점은 BindingResult는 @ModelAttribute를 붙인 오브젝트 뒤에 오는 것으로 순서가 중요하다. //필드 검증 if(StringUtils.isEmpty(item.getItemName())){ bindingResult.addError(new FieldError("item","itemName","상품명을 입력해주세요.")); } if(item.getPrice() == null || item.getPrice() =..
- Total
- Today
- Yesterday
- BindingResult
- 항해플러스
- jpa api
- exception
- 인터셉터
- 향해플러스백엔드
- hypertexttransferprotocol
- React
- Java
- filter
- react실행
- 향해플러스
- 스프링공부
- 컨트
- 항해99
- JPA
- thymleaf
- 로그인
- HTTP
- 리터럴
- 백엔드 개발자 공부
- 향해99
- Intercepter
- reject
- 예외처리
- SpringBoot
- rejectValue
- 백엔드 개발자 역량
- 스프링부트
- ArgumentResolver
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |