Home >Java >javaTutorial >How to implement default static path in springboot
Class 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
is equal to the default CLASSPATH_RESOURCE_LOCATIONS
, that is, "classpath:/META-INF/ resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"
classpath is our resource folder as shown below
The above is the detailed content of How to implement default static path in springboot. For more information, please follow other related articles on the PHP Chinese website!