The static resource files in the Spring boot project are stored under the static file, and when these static files are accessed through a browser, it is found that you must add static as a prefix to access, and after a toss, this prefix is followed Spring.mvc.static-path-pattern is related to this configuration item.
Spring: MVC: static-path-pattern:/static/**
In the APPLICATION.YML configuration file in the project, when the configuration item is present, accessing the static resource file is static, and when the configuration item is removed, no static prefix can be used for normal access.
When spring boot automatically assembles Org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration, when executed to Org.springframework.boot.autoconfigure.web.WebMvcA Utoconfiguration.webmvcautoconfigurationadapter#addresourcehandlers method, The default value for class Org.springframework.boot.autoconfigure.web.webmvcproperties#staticpathpattern is "/**". If a Spring.mvc.static-path-pattern configuration item exists in the configuration item file, the default configuration item will be overwritten.
When accessed through a browser, SPRINGMVC uses simpleurlhandlermapping for route mapping when executing to a method Org.springframework.web.servlet.handler.abstracturlhandlermapping#lookuphandler, you will use the Spring.mvc.static-path-pattern configuration items to match URLs
Spring.mvc.static-path-pattern configuration items in spring boot configuration file