Reputation: 571
After logging in on my page, spring redirects me to my main site using the following controller:
//Login Success
@GetMapping("/login-success")
public ModelAndView loginSuccess() {
return new ModelAndView("/cont/home.html");
}
the URL looks like:
http://localhost:8080/login-success
It is the HTML structure of home.html but the CSS is not loaded. If I navigate to http://localhost:8080/cont/home.html it is styled.
Thanks for the help. :)
Upvotes: 0
Views: 86
Reputation: 608
Try like this below
return new ModelAndView("/CONTEXT_PATH/cont/home.html");
OR
response.sendRedirect("/cont/home.html");
return;
specify with context path so that the page will be loaded
Upvotes: 1