Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement the default static path in springboot

Shulou Source: shulou.com Published: 2022-06-01 01:07:37 09月21日 Update

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.

Tags: Content path static article knowledge article value most that is files folders methods more steps knowledge points industry information information channels channels help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi macOS Linux Shulou Information Shulou Technology