- We're smarter than intellij when it comes to variables in our views
- Define the head fragment, including a placeholder for the page title
- Elsewhere, when the fragment is included, pass a value for the title
- In the fragment, use the passed value
- Stylesheets, images, etc go in src/main/resources/static
- These are referenced with absolute paths, relative to the static directory
- in this example, we have a css file located at
src/main/resources/static/css/style.css
, and the path we use to link it is just/css/style.css
- in this example, we have a css file located at
- you can use a th:block to surround elements with a wrapper that isn't rendered
- When the block is included, all that is rendered is a bunch of script tags