Hello, I use the config like as below and when it's running IDEA Console output log as first image, the second image is my local resources.

spring.mvc.static-path-pattern=/**
spring.web.resources.add-mappings=true
spring.web.resources.static-locations=classpath:/META-INF/resources/, classpath:/resources/, classpath:/static/, classpath:/public/

Snipaste_2022-08-16_20-02-24 2

when i create a java configuration class as below it works. i remeber that in the elder version, i use default config that write nothing in the application.properties or in the applicaiotn.yaml, at the same time, i don't create a config class about WebMvcConfig, it' still work,

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
            "classpath:/META-INF/resources/", "classpath:/resources/",
            "classpath:/static/", "classpath:/public/"
    };
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        if (!registry.hasMappingForPattern("/**")) {
            registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS);
        }
    }
}

my project use springboot and thymeleaf 2.6.10, use default config. thanks!

Comment From: mbhave

@prayjourney Please provide a minimal sample application that we can run in order to reproduce the issue. The sample can be attached as a zip to this issue or provided as a link to a separate Github repository.

Comment From: prayjourney

wang-editor5-integration.zip @mbhave, in the attached file, i commented the config class, it doesn't work, as below SpringBoot spring.web.resources.static-locations doesn't work with a custom WebMvcConfigurationSupport bean

Comment From: snicoll

Thanks for the sample @prayjourney.

The sample contributes a bean of type WebMvcConfigurationSupport which switches off Spring Boot's MVC auto-configuration. As a result, none of the configuration properties are applied. If you need to customize MVC support, please use WebMvcConfigurer instead.

Comment From: prayjourney

thanks!

Thanks for the sample @prayjourney.

The sample contributes a bean of type WebMvcConfigurationSupport which switches off Spring Boot's MVC auto-configuration. As a result, none of the configuration properties are applied. If you need to customize MVC support, please use WebMvcConfigurer instead.

Comment From: prayjourney

我已收到您的来信,谢谢!祝您生活愉快!