# Summary

@RequestMapping과 @Controller = 애노테이션으로 된 컨트롤러라고 생각!

MVC 구조에서 가장 중요한 것

* **HandlerMapping(핸들러 매핑) : 핸들러 매핑으로 요청에 대한 컨트롤러를 찾는다!**\
  클래스 레벨에 @Controller 또는 @Component+\@RequestMapping 또는 메서드 단위로@RequestMapping 를 붙이는 방법으로 매핑이 가능하다!

* HandlerAdapter(핸들러 어댑터) : 핸들러 매핑을 통해 찾은 핸들러를 실행할 수 있는 핸들러 어댑터가 필요하다.\
  ex) Controller 인터페이스를 실행할 수 있는 핸들러 어댑터를 찾고 실행해야 한다.

* HandlerMapping

1. RequestMappingHandlerMapping : 애노테이션 기반의 컨트롤러인 @RequestMapping에서 사용
2. BeanNameHandlerMappinig : 스프링 빈의 이름으로 핸들러 찾는다!

* HandlerAdapter

1. RequestMappingHandlerAdapter : 애노테이션 기반의 컨트롤러인 @RequestMapping에서 사용
2. HttpRequestHandlerAdapter : HttpRequestHandler 처리
3. SimpleControllerHandlerAdapter : Controller 인터페이스(애노테이션X, 과거에 사용)

**@Controller를 붙이는 이유⭐️⭐️⭐️⭐️⭐️**

1. 컴포넌트로 등록해서 컴포넌트 스캔 대상이 된다.
2. **RequestMappinigHandlerMapping에서 매핑 정보 대상으로 인식**한다!\
   그래서 @Controller를 붙이면 말 그대로 (애노테이션 기반의) 컨트롤러가 되는 것이다!

뷰 리졸버

지금까지 작성한 JSP의 경우 스프링 부트는 InternalResourceViewResolver라는 뷰리졸버를 자동 등록한다. JSP에 맞는 뷰를 렌더링한다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://heunnajo.gitbook.io/mvc/5.-mvc/summary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
