[Spring] MVC란?
·
Spring
MVC란 Model, View, Controller의 앞 글자만 따온 약자이다.이는 동적 콘텐츠를 만들 때 사용된다. 우선 Controller의 작동 방식부터 알아보겠다. 1. Controller는 "URL"요청에 따라 어떤 Controller가 사용되는지 결정된다.예를 들어 localhost:8080/hi-mvc?nickname=byhy0 라는 요청이 왔을때는 서버에서는 hi-mvc라는 컨트롤러가 있는지를 먼저 확인한다.@GetMapping("hi-mvc")public String helloMvc(@RequestParam("nickname") String nickname, Model model){ model.addAttribute("nickname", nickname); return "hi-templa..