# Request & Response Handling (Spring Boot) > @PathVariable, @RequestParam, @RequestBody, @RequestHeader, 콘텐츠 협상, JSON 직렬화 - 20 면접 질문 - Mid-Level - [면접 질문: Spring Boot](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions.md) ## 1. Spring MVC 컨트롤러에서 HTTP 헤더로부터 값을 추출할 수 있는 어노테이션은 무엇입니까? **답변** @RequestHeader는 들어오는 요청의 HTTP 헤더에서 값을 추출할 수 있습니다. 이 어노테이션은 특정 헤더의 값을 메서드 파라미터에 자동으로 바인딩합니다. 타입 변환을 지원하며 required=false로 선택적으로 만들 수 있습니다. 인증 토큰, 트래킹 정보 또는 Accept-Language와 같은 클라이언트 환경설정을 추출하는 데 유용합니다. ## 2. 컨트롤러 메서드에서 'sessionId'라는 이름의 쿠키 값을 가져오려면 어떻게 해야 합니까? **답변** @CookieValue는 특정 HTTP 쿠키의 값을 추출하여 메서드 파라미터에 바인딩할 수 있습니다. 이 어노테이션은 쿠키 이름을 파라미터로 받으며 자동 타입 변환을 지원합니다. required=false로 선택적으로 표시할 수도 있습니다. 세션 식별자, 사용자 환경설정 또는 분석 트래킹 토큰에 일반적으로 사용됩니다. ## 3. 컨트롤러 메서드에 HttpServletRequest를 직접 주입하는 것이 Spring MVC 어노테이션을 사용하는 것보다 덜 최적인 이유는 무엇입니까? **답변** @RequestParam, @RequestHeader 또는 @PathVariable과 같은 Spring MVC 어노테이션은 변환 처리 및 검증을 포함한 타입 지정 자동 데이터 추출을 제공합니다. HttpServletRequest를 직접 사용하면 수동 파싱이 필요하고 코드의 가독성과 테스트 용이성이 떨어집니다. 어노테이션은 또한 불변성과 API 계약의 명확성을 촉진합니다. ## 17개 추가 질문 이용 가능 - Spring MVC에서 HTTP 요청이 컨트롤러에 도달하기 전에 가로챌 수 있는 인터페이스는 무엇입니까? - Spring MVC 애플리케이션에서 커스텀 인터셉터를 등록하려면 어떻게 해야 합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Spring Boot 면접 주제 - [Spring Core - IoC & DI](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-core-ioc-di.md): 22개 질문, Junior - [Spring Boot Auto-Configuration](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-auto-configuration.md): 20개 질문, Junior - [Spring Boot Starters](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-starters.md): 18개 질문, Junior - [Application Properties & YAML](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/application-properties-yml.md): 16개 질문, Junior - [SLF4J 및 Logback을 사용한 로깅](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/logging.md): 20개 질문, Junior - [Spring Boot DevTools](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-devtools.md): 15개 질문, Junior - [Spring MVC Basics](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-mvc-basics.md): 20개 질문, Mid-Level - [Spring REST Controllers](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-rest-controllers.md): 20개 질문, Mid-Level - [예외 처리](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/exception-handling.md): 25개 질문, Mid-Level - [Bean Validation](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/bean-validation.md): 25개 질문, Mid-Level - [Spring Data JPA 기초](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-data-jpa-basics.md): 25개 질문, Mid-Level - [JPA 엔티티 및 관계](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jpa-entities-relationships.md): 30개 질문, Mid-Level - [JPA 쿼리](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jpa-queries.md): 30개 질문, Mid-Level - [Spring Data Repositories](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-data-repositories.md): 25개 질문, Mid-Level - [Spring Security 기초](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-security-basics.md): 25개 질문, Mid-Level - [Spring Boot Actuator](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-actuator.md): 20개 질문, Mid-Level - [JUnit과 Mockito를 사용한 단위 테스트](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/testing-junit-mockito.md): 30개 질문, Mid-Level - [Spring Boot 테스트](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-testing.md): 30개 질문, Mid-Level - [Profiles와 Environment](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/profiles-environment.md): 20개 질문, Mid-Level - [RestTemplate 및 WebClient](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/resttemplate-webclient.md): 24개 질문, Mid-Level - [Async와 스케줄링](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/async-scheduling.md): 25개 질문, Mid-Level - [Spring을 사용한 캐싱](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/caching.md): 25개 질문, Mid-Level - [Spring WebFlux (리액티브)](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-webflux.md): 25개 질문, Mid-Level - [Spring 트랜잭션](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/transactions.md): 30개 질문, Senior - [고급 인증 및 인가](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/authentication-authorization.md): 30개 질문, Senior - [JWT 및 스테이트리스 보안](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jwt-stateless-security.md): 20개 질문, Senior - [OAuth2와 Authorization Server](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/oauth2-authorization-server.md): 20개 질문, Senior - [Spring Boot와 Docker](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-docker.md): 19개 질문, Senior - [Spring을 활용한 마이크로서비스](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/microservices-basics.md): 25개 질문, Senior - [Spring Cloud Config](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-cloud-config.md): 19개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/performance-optimization.md): 30개 질문, Senior - [GraalVM Native Images](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/graalvm-native-images.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/request-response-handling