[JAVA] Spring Boot + Thymeleaf BootStrap installation method memo

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

Spring Boot + Thymeleaf BootStrap installation method memo
Spring boot controller method memo
Spring boot memo writing (1)
Spring boot memo writing (2)
[Java] Thymeleaf Basic (Spring Boot)
Spring Security Usage memo Method security
◆ Spring Boot + gradle environment construction memo
Spring Boot + PostgreSQL error resolution method
A memo that touched Spring Boot
Thymeleaf usage notes in Spring Boot
Spring Boot environment construction memo on mac
Loosen Thymeleaf syntax checking in Spring Boot
Use DynamoDB query method in Spring Boot
Implement CRUD with Spring Boot + Thymeleaf + MySQL
Implement paging function with Spring Boot + Thymeleaf
Run WEB application with Spring Boot + Thymeleaf
Spring retrospective memo
Use Thymeleaf text template mode from Spring Boot
During Spring Boot Property Japanese Message-like installation problem
Challenge Spring Boot
Create CRUD apps with Spring Boot 2 + Thymeleaf + MyBatis
Create your own Utility with Thymeleaf with Spring Boot
Spring Boot Form
Apply Twitter Bootstrap 4 to Spring Boot 2 using Webjars
Spring Boot Memorandum
gae + spring boot
If you want to separate Spring Boot + Thymeleaf processing
Spring Security usage memo: Cooperation with Spring MVC and Boot
[Introduction to Spring Boot] Submit a form using thymeleaf
JJUG CCC Spring 2018 memo
Spring Shell usage memo
Java learning memo (method)
[Java ~ Method ~] Study memo (5)
First Spring Boot (DI)
SPRING BOOT learning record 02
Spring Boot2 cheat sheet
Spring Boot exception handling
Spring Boot Servlet mapping
Spring boot development-development environment-
Dot installation study memo 01
Learning Spring Boot [Beginning]
Spring Boot 2.2 Document Summary
[Spring Boot] DataSourceProperties $ DataSourceBeanCreationException
Spring Boot 2.3 Application Availability
Spring boot tutorials Topics
Download with Spring Boot
Handle Java 8 date and time API with Thymeleaf with Spring Boot
Until INSERT and SELECT to Postgres with Spring boot and thymeleaf
Use thymeleaf3 with parent without specifying spring-boot-starter-parent in Spring Boot