How to solve the loss of css, js and picture style when the Springboot+Thymeleaf page jumps back to the original page

I often encounter this problem when working on projects. Here is the solution:
Here is the path I wrote:
Insert picture description here
After the problem of css, js, img style loss, F12 can find that the path has changed, so we changed it to an absolute path Way:
Insert picture description hereInsert picture description hereThis can solve the resource 404 problem after the page jumps!

Guess you like

Origin blog.csdn.net/Pzzzz_wwy/article/details/106204547