404 problem with page static resources when forwarding by servlet, springmvc, springboot

table of Contents


Does not discuss static resource filtering. . .

  1. This problem redirects will not 404, because the redirect is to find the corresponding page, which is determined by the browser.

  2. And forwarding in the same directory will find resources. But forwarding from the controller (root directory) to the directory below the root directory, the forwarding can pass, but the resources found on the page are still resources under the root path.

  3. The solution
    puts a slash / before each referenced resource to represent the resources under the project

Springboot can solve the same problem as above, but after 8080 is added,

thymeleaf will be used to take over the access path of the project!

Guess you like

Origin blog.csdn.net/qq_44783283/article/details/109230979