springbootweb imports static resources

first step

Import the maven dependency of jquery
<dependency>
    <groupId>org.webjars</groupId>
    <artifactId>jquery</artifactId>
    <version>3.6.0</version>
</dependency>

Second step

Create a directory in the source code

Test visit

Insert picture description here

hello1

Visit in the browser: http://localhost:8080/d.js
can successfully access the static resources we wrote.
Insert picture description here
If you create the same name in three folders,
Insert picture description here
it will execute the folder with the highest priority.

resources>static>public

Guess you like

Origin blog.csdn.net/weixin_45967375/article/details/115204802