addAtrribute (1) MVC 패턴- @RequestParam http://localhost:8080/hello-mvc?name=ayon 실행 -> @RequestParam("name") String name > String 타입의 이름이 name인 변수에 ayon을 담는다. -> model.addAttribute("name", name); > model을 통해 name=ayon 값을 넘겨준다. -> hello-template.html을 return 한다. // @RequestParam(name = "name", required = false) 일 경우 http://localhost:8080/hello-mvc 를 실행하면 name=null 이 넘어가게 된다. required의 default는 true 인데 true의 경우 name 에 값을 담아주지 않으면 오류페이지.. 이전 1 다음