I am able to write the following method which loads my static files fine:
@GetMapping("/register")
public String newRegister(HttpServletRequest request, Model model) {
return "register";
}
However, when I add and {Id}
to the url:
@GetMapping("/register/{Id}")
public String newRegister(HttpServletRequest request, Model model) {
return "register";
}
all of the static files error, with a message such as:
2018-07-05 08:42:24.969 WARN 52397 --- [nio-8080-exec-4] o.s.web.servlet.PageNotFound :
No mapping found for HTTP request with
URI [/hi/js/all.js] in DispatcherServlet with name 'dispatcherServlet'
2018-07-05 08:42:24.969 WARN 52397 --- [nio-8080-exec-3] o.s.web.servlet.PageNotFound
: No mapping found for HTTP request with
URI [/hi/img/google-logo.svg] in DispatcherServlet with name 'dispatcherServlet'
2018-07-05 08:42:25 DEBUG GreetingController:40 - *****123
2018-07-05 08:42:25.563 WARN 52397 --- [nio-8080-exec-7] o.s.web.servlet.PageNotFound : No mapping found for HTTP request with
URI [/hi/css/all.css] in DispatcherServlet with name 'dispatcherServlet'
Why does this occur, and how would I fix it? Here is an example of the project structure: