강의

멘토링

커뮤니티

Inflearn Community Q&A

ligun0319's profile image
ligun0319

asked

Spring Boot Introduction by Example

(09) Using Validator

(09) Validator 사용하기 @ModelAttribute("dto") 가 사용된 이유?

Written on

·

260

0

MyController.java 의 insert2 메소드에서 인자 값에 @ModelAttribute("dto") 가 사용된 이유가 부족한 것 같습니다. 

modelattribute어노테이션spring-boot

Answer 1

0

java님의 프로필 이미지
java
Instructor

 public String insert2(@ModelAttribute("dto") ContentDto contentDto,

                  BindingResult result)

파라미터 변수명은 contentDto 이지만 모델에 추가할 변수 값으로 dto 라는 짧은 변수값으로 사용하기 위한 설정입니다. 

ligun0319's profile image
ligun0319

asked

Ask a question