Okay so as far as I know I'm using the correct set up for to link resources for Thymleaf resources in a spring boot project
Currently i'm linking them using the following:
<link href="../static/css/bootstrap.css" th:href="@{css/bootstrap.css}"
rel="stylesheet" media="screen" />
<link href="/css/bootstrap-theme.css"
th:href="@{css/bootstrap-theme.css}" rel="stylesheet" media="screen" />
<script type="text/javascript" src="/js/jquery-2.2.2.js"
th:src="@{js/jquery-2.2.2.js}"></script>
<script type="text/javascript" src="/js/tether.js"
th:src="@{js/tether.js}"></script>
My routing path in my controller are
@RequestMapping(value = "/mvchome", method = RequestMethod.GET)
public String mvchome(Model model) {
Post post = new Post();
model.addAttribute("post", post);
return "mvchome";
}
When I go to this page using /mvchome it loads the bootstrap properly, with the full form, however when I try to load /mvchome/ it loads the form properly but the bootstrap is not showing up.
Also not sure if it matters but I'm also using spring security. Just would like to know if anyone knows why this is happening and ideas on how to fix it.
Thanks
***Modified bootstrap link as suggested and it still does not load the css on /mvchome/
Also I took a look at chrome in the sources and it seems that if it using /mvchome/ it changes the resources path