I stumbled upon the introduction of bootstrap in an application that uses the thymeleaf template engine, so a quick note for the future
Write what is called webjars in a pom file
pom.xml
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>4.2.1</version>
</dependency>
Read css in html file I'm addicted to 1 If you are using thymeleaf Th: href = "@ {webjars / bootstrap / version /css/bootstrap.min.css}".
I'm addicted to 2 If you have security, you must allow access to webjars.
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/webjars/**");
}
Extra In order to prepare css by yourself, it seems that it will not be read unless you prepare and place a static folder in src / main / resources.
Recommended Posts