개발 등/SPRING

javax.servlet.ServletException: Could not resolve view with name 'redirect:/swagger-ui/index.html' in servlet with name 'dispatcherServlet'

darkhorizon 2023. 4. 3. 11:34
728x90
반응형

Spring boot Swagger 3.0을 적용했을 때  

javax.servlet.ServletException: Could not resolve view with name 'redirect:/swagger-ui/index.html' in servlet with name 'dispatcherServlet'

리다이렉트 에러가 발생하는 경우 Swagger  설정 파일에 다음 코드를 추가하면 된다.

 

@Bean
public InternalResourceViewResolver defaultViewResolver() {
    return new InternalResourceViewResolver();
}

 

728x90