CodePudding user response:
Register a WebMvcConfigurationAdapter bean, realizing addViewControllers methodCodePudding user response:
Your View path and viewName/ws, dead cycleRegistry. AddViewController ("/ws ") setViewName (" ws ");
CodePudding user response:
Don't need to/write directly in setViewName name itCodePudding user response:
Did you write addViewControllers WebMvcConfigurerAdapter object Adapter, and to give WebMvcConfig returns a AdapterCodePudding user response:
Why in addViewControllers add multiple views can also play a role, it is how to determine the implementation of that?
@ Slf4j
//view controller;
@ Configuration
Public class WebViewConfig implements WebMvcConfigurer {
@ Override
Public void addViewControllers (ViewControllerRegistry registry) {
Registry. AddViewController ("/admin ".) setViewName (" admin/login ");
Registry. AddViewController ("/"). SetViewName (" index ");
}
}