Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- jpa
- AOP
- java
- 자바
- 스프링 핵심 원리
- Greedy
- SpringBoot
- Exception
- 백준
- 김영한
- 그리디
- JDBC
- http
- JPQL
- Android
- pointcut
- db
- 알고리즘
- transaction
- Proxy
- 인프런
- kotlin
- 스프링
- QueryDSL
- Spring Boot
- Servlet
- Thymeleaf
- 스프링 핵심 기능
- spring
- springdatajpa
Archives
- Today
- Total
목록ObjectError (1)
개발자되기 프로젝트
BindingResult1
지금부터 스프링이 제공하는 검증 오류 처리 방법 중 BindingResult를 알아보자. 1. 변경 전 @PostMapping("/add") public String addItem(@ModelAttribute Item item, RedirectAttributes redirectAttributes, Model model) { //검증 오류 결과를 보관 Map errors= new HashMap(); //검증 로직 if(!StringUtils.hasText(item.getItemName())){ errors.put("itemName", "상품 이름을 필수 입니다."); } } 2. BindingResult 적용 @PostMapping("/add") public String addItemV1(@ModelAtt..
인프런/[인프런] 스프링 MVC 2
2021. 9. 24. 18:22