A note about static file access in spring-boot.
spring boot is the default setting,
By placing it below, access is possible.
As an example, When HTML is placed in each directory as shown below
project root └─ src └─ main └─ resources ├─ static | └─ html | └─ 1.html ├─ public | └─ html | └─ 2.html ├─ resources | └─ html | └─ 3.html └─ META-INF └─ resources └─ html └─ 4.html
To each HTML,
It becomes possible to access in the form of.
When a file with the same name exists in each directory as shown below
project root └─ src └─ main └─ resources ├─ static | └─ html | └─ test.html ├─ public | └─ html | └─ test.html ├─ resources | └─ html | └─ test.html └─ META-INF └─ resources └─ html └─ test.html
When you access
META-INF / resources / html / test.html is returned
The search order for static files is
The search is performed in the order of, and the one found first is returned on the screen.
Does not seem to be suitable for placing static files, as it also contains configuration files.
When actually using it in a project,
I think it will be placed in.
Something that doesn't change, such as a library, in
resources / static /.
resources / public / Place project-specific css, js, etc.
Is it like that? .. ..
Hmmm. I don't know what is best practice around here, so I don't know if this is all right. Someone who teaches and knows (； ∀ ；)