WebDev/본과정

Spring의 Form 데이터 값 검증, JS의 이벤트 처리

Raadian 2021. 5. 16. 01:45

1. 아래 annotation 의 용도는?

@ModelAttribute

: 커맨드 객체의 이름 개발자가 임의로 변경 할 수 있는 기능이다,

@RequestMapping("/studentView")
// @ModelAttribute("studentInfo"): 기존 StudentInformation 객체 명을 studentInfo로 변경한다.
public String studentView (@ModelAttribute("studentInfo") StudentInformation studentInformaton) {
    return "studentView";
}