Spring boot accesses static resources and reports Request method 'GET' not supported

when you use springboot+ssm+jsp to create a project and visit it, you find that the page is loaded, but the style referenced on the page is reported to net::ERR_ABORTED 405 (Method Not Allowed)
A lot of answers have been read on the Internet. Changing post to get has no effect. Seek the boss"s solution!
Picture description

Mar.30,2022

take a look at


springboot to add the configuration of static. Spring.mvc.static-path-pattern: / statics/**


webapp is set, and there is a problem with the position or order of introduction


Spring Boot project default resource directory resources/public
you can add

if you want to modify it
@Configuration
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry
          .addResourceHandler("/resources/**")
          .addResourceLocations("/resources/"); 
    }
}
Menu