I'm new to thymeleaf and springboot.
I create a springboot project with thymeleaf in IntelliJ IDEA with "New Project"->"Spring Initalizr".
Then I get a project whose structure looks like below.
demo
|+-src/main
| +-java
| +-resources
| static
| templates
| application.properties
|-pom.xml
The question is what should I put in static and templates under resources? What's the difference between them?
I guess the .html files that have thymeleaf attributes should be put in templates. How about static html, css and js?
Thanks.
templates
folder is a place where you put all the thymeleaf templates. It is a default directory (by default spring will look inside for any templates).
static
folder is used for serving web static content, all the css, js, html etc. (also default folder search by spring)
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With