스프링 MVC config - by 콩하나 #6
-
질문해주세요 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
@EnableWebMvc가 @SpringWebMvcConfiguration을 가져온다고 들은 것 같은데 제대로 이해한 게 맞나요? @configuration이랑 @EnableWebMvc가 같이 적용되고 있는데 두 개를 같이 적용할 필요가 있나요? @SpringWebMvcConfiguration은 @configuration의 역할(빈 설정)을 해주지 못하나요? |
Beta Was this translation helpful? Give feedback.
-
configureMessageConverters를 통해 ObjectMapper를 커스터마이징 하는 예시를 보여주셨는데, ObjectMapper를 개발자가 직접 커스텀 후 빈으로 등록하는 것과 동일한가요 ?_? |
Beta Was this translation helpful? Give feedback.
-
@configuration과 @EnableMvc를 함께 사용하면, 스프링에서 기본 설정 해놓은 mvc-configuration이 동작하지 않는다고 했던 것 같은데, |
Beta Was this translation helpful? Give feedback.
-
(이레가 남기신 질문과 동일한 질문인 것 같아요 😂 #6 (comment))
라는 특징을 가지는 것 같아요! 제가 이해한 바로는 사실 저로서는 스프링의 기본 configuration이 빠지게 된다면 문제가 생길 수 있지 않을까? 라는 생각이 드는데요, 그럼에도 |
Beta Was this translation helpful? Give feedback.
-
발표 자료 보면서 제가 대충 정리해본 건데 맞는 흐름인지가 궁금하네요 ㅎㅎ (러버덕으로 사용할게요...🐤) 개발자가 configuration 정보를 등록하는 방법에는 2가지가 있다.
하지만, 앞서 말한 첫 번째 방법인 WebMvcAutoConfiguration의 경우 WebMvcConfigurationSupport이 빈으로 등록되어 있지 않은 경우에만 활성화되기 때문에, @EnableWebMvc를 사용하게 되면 무시된다. 요기까지가 읽으면서 정리한 거구...! 궁금한 거 몇 가지만 질문드릴게요.
저는 오히려 @configuration와 @EnableWebMvc을 함께 사용한다면 설정 정보가 무시되기 때문에 혼용하지 않는 편이 좋지 않나요? 제가 어디서부터 잘못 이해한 것일까요 ;ㅅ;
|
Beta Was this translation helpful? Give feedback.
(이레가 남기신 질문과 동일한 질문인 것 같아요 😂 #6 (comment))
@EnableWebMvc
를 붙이면라는 특징을 가지는 것 같아요!
제가 이해한 바로는
@Configuration
을 사용하는 것만으로도 1번 특징인 "설정 정보를 커스텀 할 수 있다"를 만족하는 것 같은데,Spring이 기본적으로 제공해주는 Configuration을 무시하면서
@EnableWebMvc
를 사용해야하는 상황이 무엇이 있을지 궁금해요! (사용해야 하는 이유가 궁금합니다 ㅎㅎ)사실 저로서는 스프링의 기본 configuration이 빠지게 된다면 문제가 생길 수 있지 않을까? 라는 생각이 드는데요, 그럼에도
@EnableWebMvc
라는 어노테이션이 존재하는 이유가 있을 것 같아서요~!