[23기_안준석] spring tutorial 미션 제출합니다.#11
Open
fervovita wants to merge 1 commit intoCEOS-Developers:fervovitafrom
Open
[23기_안준석] spring tutorial 미션 제출합니다.#11fervovita wants to merge 1 commit intoCEOS-Developers:fervovitafrom
fervovita wants to merge 1 commit intoCEOS-Developers:fervovitafrom
Conversation
gitaehee
reviewed
Mar 15, 2026
Comment on lines
+718
to
+723
| 참고) 위의 흐름은 HTML를 반환할 때의 방식이다. | ||
| 데이터를 JSON 형식으로 주고받는 다면 **5-7**과정이 아래와 같이 바뀐다. | ||
|
|
||
| 5. **객체 반환** : 컨트롤러는 `@ResponseBody` 또는 `@RestController`가 사용된 경우, ModelAndView 대신 실제 데이터 객체(DTO, Map 등)나 `ResponseEntity`를 반환한다. | ||
| 6. **메세지 컨버터 작동(HttpMessageConverter)** : Dispatcher Servlet은 반환된 객체의 타입과 클라이언트가 요청한 응답 타입을 확인하여 적절한 `HttpMessageConverter`를 선택한다. | ||
| 7. **JSON 변환 및 응답** : 선택된 컨버터(ex. Jackson)가 자바 객체를 JSON 텍스트로 변환하여 HTTP 응답 body에 직접 쓰고 응답을 보낸다. No newline at end of file |
There was a problem hiding this comment.
오 HTML을 반환할 때와 JSON형식으로 주고받을 때를 구분해서 적어주신 점이 좋네요
두 개가 동작이 다르군요
gitaehee
reviewed
Mar 15, 2026
Comment on lines
+137
to
+139
| `@Autowired`를 사용하면, 스프링 컨테이너가 자동으로 헤당 스프링 빈을 찾아서 주입해준다. | ||
| (생성자가 1개만 있으면, `@Autowired`는 생략 가능하다.) | ||
| (`@Autowired`는 스프링 컨테이너에 주입할 대상을 찾지 못하면 오류가 발생한다. 주입할 대상이 없어도 동작하게 하려면 `@Autowired(required=false)`를 사용해야 한다.) |
There was a problem hiding this comment.
@Autuwired에 대해서 자세하게 정리해두셨네요
나중에 참고하겠습니다!!
taeik21
reviewed
Mar 15, 2026
taeik21
left a comment
There was a problem hiding this comment.
과제하시느라 고생 많으셨습니다!
미션에 대한 내용 뿐만 아니라, 관련된 추가 개념들과 개발 시 유의사항들까지 정리해주셔서 많이 배울 수 있었습니다!
Comment on lines
+247
to
+248
| 참고) | ||
| 클래스 외부에서 호출할 때는 프록시 객체가 중간에 가로채서 부가 기능을 실행해주지만, 클래스 내부에서 다른 메서드를 호출하면 프록시를 거치지 않고 실제 객체의 메서드(this)를 실행하는 **self-invocation** 문제가 발생한다. |
There was a problem hiding this comment.
AOP 프록시 객체의 특성 때문에 발생하는 self-invocation 문제를 코드 예시와 함께 설명해주셔서, 덕분에 새로운 개념을 확실히 배울 수 있었습니다!
Comment on lines
+639
to
+640
| 참고) **`@Primary`와 `@Qualifier`의 우선순위** | ||
| 스프링은 항상 좁은 범위 선택권이 우선순위가 높기 때문에, 상세하게 지정하는 `@Qualifier`의 우선순위가 `@Primary`보다 높다. |
There was a problem hiding this comment.
@primary와 @qualifier의 우선순위에 대해 생각해본 적이 없었는데, 둘의 차이를 명확하게 짚어주셔서 이번 기회에 확실히 정리하고 갑니다. 감사합니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.