I have a simple webpage and want to add JS to it.
The controller rendering the page is -
@Controller
@RequestMapping("/testui")
public class GreetingController {
@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
model.addAttribute("name", name);
return "pages/greeting";
}
}
The struture of my resources folder are -
src/main/resources
|
-- static
--templates
|
--css
--js
--pages
The Thymeleaf page is -
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
Welcome to the future
</body>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
</html>
PS - I have also tried -
<script type="text/javascript" th:src="@{js/jquery-1.10.2.min.js/}"></script>
But same problem