How to implement the default static path in springboot
Most people don't understand the knowledge points of this article "how to implement default static path in springboot", so Xiaobian summarizes the following contents for everyone, the contents are detailed, the steps are clear, and there is certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "how to implement default static path in springboot".
ResourceProperties.class
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"};private String[] staticLocations;public ResourceProperties() { this.staticLocations = CLASSPATH_RESOURCE_LOCATIONS; this.addMappings = true; this.chain = new ResourceProperties.Chain(); this.cache = new ResourceProperties.Cache();}
According to the construction method, staticLocations equals the default CLASSPATH_RESOURCE_LOCATIONS, i.e."classpath:/META-INF/resources/, ""classpath:/resources/, ""classpath:/static/, ""classpath:/public/."
classpath is our resource folder as shown below
The above is the content of this article on "how to implement the default static path in springboot". I believe everyone has a certain understanding. I hope the content shared by Xiaobian will help everyone. If you want to know more relevant knowledge, please pay attention to the industry information channel.