public class DispatcherServlet extends FrameworkServlet {
public static final String MULTIPART_RESOLVER_BEAN_NAME = "multipartResolver";
public static final String LOCALE_RESOLVER_BEAN_NAME = "localeResolver";
public static final String THEME_RESOLVER_BEAN_NAME = "themeResolver";
public static final String HANDLER_MAPPING_BEAN_NAME = "handlerMapping";
public static final String HANDLER_ADAPTER_BEAN_NAME = "handlerAdapter";
public static final String HANDLER_EXCEPTION_RESOLVER_BEAN_NAME = "handlerExceptionResolver";
public static final String REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME = "viewNameTranslator";
public static final String VIEW_RESOLVER_BEAN_NAME = "viewResolver";
public static final String FLASH_MAP_MANAGER_BEAN_NAME = "flashMapManager";
//해당 클래스에서
@Nullable
protected View resolveViewName(String viewName, @Nullable Map<String, Object> model, Locale locale, HttpServletRequest request) throws Exception {
if (this.viewResolvers != null) {
Iterator var5 = this.viewResolvers.iterator();
while(var5.hasNext()) {
ViewResolver viewResolver = (ViewResolver)var5.next();
View view = viewResolver.resolveViewName(viewName, locale);
if (view != null) {
return view;
}
}
}
return null;
}
Iterator var5 = this.viewResolvers.iterator();
//viewResolvers에는 내가 스프링에 정의한 viewResolver들이 order 순서대로 정리되어잇다.
//하위 인터페이스를 상속받은 클래스 중 빈으로 등록되어있고 재정의된 resolveViewName에서
//view를 찾게되면 view를 리턴.
public interface ViewResolver {
@Nullable
View resolveViewName(String var1, Locale var2) throws Exception;
}
'Programming Bookmark > Spring - Java' 카테고리의 다른 글
springboot actuator prometheus 사용시 io.prometheus.client.CollectorRegistry 사용하기(io.prometheus.client.Counter) (0) | 2021.01.15 |
---|---|
Missing required configuration "key.serializer" which has no default value - spring kafka 설정시 에러 (0) | 2020.04.09 |
Spring boot Test MockMvc 사용하여 테스트하기 (0) | 2019.12.16 |
java local ip spring에서 쉽게 얻기 (0) | 2019.12.03 |
Spring security 래퍼런스와 Github 주소 공유 (0) | 2019.05.09 |