SpringBoot default storage location is the static resource files in:
inside.
Note: SpringBoot in src / main / resources / resources folder corresponding to the classpath :.
Note: At this point the four default folders are ineffective, if you want four default folders are still valid, you can add many times that four specified in the configuration folder by .addResourceHandler class.
Second way: through a configuration file
# Set when the URI is / static / **, just been to static resources
# Note: If set / **, then access will represent any path through the static resources
spring.mvc.static-path-pattern=/static/**
# Custom Path
# Note: The custom path, four default folders "resoures file in the META-INF folder under the still valid, three other folders fail
# (In this case: Access ip: port number / static / time, corresponding to access to the "custom file folders" and "resoures META-INF files in folder");
# Note: when searching for files, priority custom folders to be higher than the default four folders
spring.resources.static-locations=classpath:/static/
# Tip: If we explicitly to custom folders and four default folders down, and it will be effective (this time, the priority order from left to right)
#spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/myFile/
Recommended use Second, use 1 when it seems otherwise normal request will be intercepted, resulting in can not access
Transfer: https: //www.jianshu.com/p/e8849e2c3195