The test.js file created in the resources/static directory of the current project returns 404. A new empty Springboot project can be accessed without any special configuration.

We all know that Springboot supports reading “classpath:/ meta-INF /resources/”, “classpath:/resources/” via @webMvCautoConfiguration, “Classpath :/static/”, “classpath:/public/”} files in convention directories. So why does it fail?

It turns out that WebMvcAutoConfiguration has a special condition in this annotation. To come into force when WebMvcConfigurationSupport no load.

Then I went to the project and looked around. Sure enough, I found the following code

public class InterceptorHandler extends WebMvcConfigurationSupport {
}
Copy the code

Finally find the root of the problem, and then according to this request to show the specified load path can be.

Reference: www.cppcns.com/ruanjian/ja…