GetMapping, PostMapping을 쓰려면 아래 환경설정을 꼭 해야한다.
그런데 이 두 어노테이션은 스프링 버전 4.3.x 버전부터 사용 가능하며, 이전 버전에서는 사용할 수 없기 때문이다.

poom.xml에 가서 스프링버전을 5.2.0으로 바꾼다.
그리고 poom.xml 우클릭 > maven > update한다.

그러면 이렇게 maven dependencies가보면 5.2.0으로 다 바뀌어있다.
@RequestMapping("/register/add")을 할 때 같은 이름으로 맵핑을 받으면 에러가 난다. (Ambiguous mapping. error)@RequestMapping(value = "/register/add", method = RequestMethod.GET), @RequestMapping(value = "/register/add", method = RequestMethod.POST) 로 각각해놓으면 되는데 이것은 옛날 방식이라 잘 사용하지 않는다. @GetMapping("/register/add"), @PostMapping("/register/add") 으로 각각 설정해놓으면 된다. @RequestMapping(value = "/register/add", method = RequestMethod.GET)@RequestMapping(value = "/register/add", method = RequestMethod.POST)@RequestMapping(value = "/register/add", method = {RequestMethod.GET, RequestMethod.POST})