폼 서브밋
-
핸들러 메소드 4부: 폼 서브밋 (타임리프)SPRING/스프링 MVC 2021. 7. 3. 01:08
폼을 보여줄 요청 처리 - GET /events/form - 뷰: events/form.html - 모델: “event”, new Event() 타임리프 - @{}: URL 표현식 - ${}: variable 표현식 - *{}: selection 표현식 @Controller public class SampleController { // form.html 화면 호출 @GetMapping("/events/form") public String eventsForm(Model model) { Event newEvent = new Event(); newEvent.setLimit(50); model.addAttribute("event",newEvent); return "events/form"; } @PostMappi..