I'm building a Spring MVC application with Thymeleaf as the template language. I tried so many things but I was not able to include my CSS file in my Thymeleaf templates. What am I doing wrong?
My project structure is as follows.
project
src/
main/
java/
resources/
web/
WEB-INF/
web.xml
dispatcher-servlet.xml
views/
css/
bootstrap.min.css (and other css files)
index.html
And my index.html looks as follows.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<title>Hello Spring MVC</title>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
</head>
<body>
...
</body>
</html>
When I run my application, the index.html is shown, but the css is not found.
How do I need to include the css?