简体   繁体   中英

Swagger error Springboot Could not resolve view with name 'forward:/swagger-ui/index.html'

Springboot 2.5.13, swagger2: implementation "io.springfox:springfox-boot-starter:3.0.0" implementation "io.springfox:springfox-swagger-ui:3.0.0"

Runtime error: Could not resolve view with name 'forward:/swagger-ui/index.html'

The solution: create a bean like this:

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

source: https://github.com/springdoc/springdoc-openapi/issues/236

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM