Springboot solves swagger UI/index HTML Access Error 404
Recently, I was working on a project to adopt swagger 3.0. After the project is started, access the swagger path: http://localhost:8880/vdmpess -web/swagger-ui/index. HTML reports 404 because webmvcconfig inherits webmvcconfigurationsupport. After inheriting this class, the relevant contents configured in the configuration file will become invalid and the static resource needs to be re specified
the swagger static resource needs to be re specified.
Swagger address in project
Solution:
Adds the address of the specified static resource
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.
addResourceHandler("/swagger-ui/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
.resourceChain(false);
}
}
Read More:
- SpringBoot+Swagger Error: 403 Forbidden [How to Solve]
- Springboot error about swagger startup [How to Solve]
- [Solved] swagger Docmentation Access Error: Illegal DefaultValue 1024 for parameter type integer, java.lang.NumberFormatException
- [Solved] Springboot integrate swagger error: failed to start bean ‘documentationpluginsbootstrapper‘
- Springboot Integrate Swagger2 Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- [Solved] Springboot integrate swagger error: Failed to start bean ‘documentationPluginsBootstrapper‘
- Springboot2.6.X configurate swagger error [How to Solve]
- How to Solve Swagger error: IllegalStateException
- How to Solve Swagger Always Displays “basic-error-controller” Issue
- Springboot WARNING: An illegal reflective access operation has occurred
- How to Solve Swagger error: typeerror: failed to fetch
- [Solved] SpringBoot Create Project and Failed to Access localhost:8080 Error
- [Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP
- Springboot integrates Redis annotation and access error: java.io.NotSerializableException: com.demo.entity.MemberEntity
- [Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““
- [Solved] Swagger request error: error:getaddrinfo ENOTFOUND
- Springboot controls the startup of rabbitmq through configuration files
- Problems in springboot upgrade 2.4.0: when allowcredentials is true, allowedorigins cannot contain the specia
- Spring boot real time HTML page
- [Solved] SpringBoot Date Convert Error: JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime`