[JAVA] WebMvcConfigurer Memorandum of Understanding for Spring Boot 2.0 (Spring 5)

Introduction

I courageously changed the app I made with Spring Boot 1.5.10 to Spring Boot 2.0, but the WebMvcConfigurerAdapter was deprecated, so make a note. It's because Spring4 → Spring5.

Addendum) 2.0.0 I summarized all the things about migration in here.

Javadoc teacher taught me

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.html

as of 5.0 WebMvcConfigurer has default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this adapter

I see, java8 or later is required from Spring5, so the default method can be used.

Treatment

** WebMvcConfig.java before change **

WebMvcConfig before change.java


@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter
{
    //Abbreviation
}

** Modified WebMvcConfig.java **

WebMvcConfig after change.java


@Configuration
public class WebMvcConfig implements WebMvcConfigurer
{
    //Abbreviation
}

only this.

end

Digression

Thymeleaf's own Dialect is also an error!

Recommended Posts

WebMvcConfigurer Memorandum of Understanding for Spring Boot 2.0 (Spring 5)
Memorandum of understanding when Spring Boot 1.5.10 → Spring Boot 2.0.0
Spring Boot Memorandum
A memorandum of addiction to Spring Boot2 x Doma2
Memorandum of understanding about LOD.
Spring Boot for annotation learning
Introductory hands-on for beginners of Spring 5 & Spring Boot 2 has been released
Spring Boot for the first time
Going out of message (Spring boot)
Frequent annotations for Spring Boot tests
[Spring Boot] Role of each class
Use DBUnit for Spring Boot test
Local file download memorandum in Spring Boot
Spring Integration Study memorandum ~ Understanding Spring Integration Sample 3. Enricher ~
Features of spring framework for java developers
Resolve null pointers for various sessions during MVC testing of Spring boot.
Memorandum of Understanding for Using Appium desktop Inspector with Emulator (Android App)
Spring Integration Study memorandum ~ Understanding Spring Integration Sample 1. Hello World ~
Book introduction: Spring Boot Recommended reference book for beginners!
Summary of what I learned about Spring Boot
Spring Integration Study memorandum ~ Understanding Spring Integration Sample 2. JMS Gateway ~
[FCM] Implementation of message transmission using FCM + Spring boot
Playground Code for easy understanding of CGAffineTransform parameters
Let's check the feel of Spring Boot + Swagger 2.0
Various correspondence table of Spring Framework and Spring Boot
When @Transactional of Spring Boot does not work
Challenge Spring Boot
[Java / Spring Boot] Spring security ④ --Implementation of login process
Construction and impression of Spring Boot Admin ~ Tips for displaying Git commit information ~
[Java / Spring Boot] Spring security ⑤ --Implementation of logout processing
Annotation notes when writing tests for Spring Boot
Spring Boot Form
gae + spring boot
I need validation of Spring Data for Pageable ~
[Verification] Comparison of Spring Boot vs Micronaut boot speed
Memorandum (Spring Web)
Let's make a circuit breaker for back-end service using Actuator of Spring Boot (Part 1)
Plans to support JDK 11 for Eclipse and Spring Boot
Settings for connecting to MySQL with Spring Boot + Spring JDBC
Specify the encoding of static resources in Spring Boot
How to set Dependency Injection (DI) for Spring Boot
I checked asynchronous execution of queries in Spring Boot 1.5.9
Access the built-in h2db of spring boot with jdbcTemplate
05. I tried to stub the source of Spring Boot
I tried to reduce the capacity of Spring Boot
Customizer for Platform Transaction Manager added from Spring Boot 1.5
How to use CommandLineRunner in Spring Batch of Spring Boot
[Java] When writing the source ... A memorandum of understanding ①
A memorandum when creating a REST service with Spring Boot
Create Restapi with Spring Boot ((1) Until Run of App)
How to boot by environment with Spring Boot of Maven
Specify spring.profiles.active via context-param of web.xml in Spring Boot
[Spring] Pitfalls of BeanUtils.copyProperties
SPRING BOOT learning record 01
Spring Boot + Heroku Postgres
About DI of Spring ①
First Spring Boot (DI)
SPRING BOOT learning record 02
Spring Boot2 cheat sheet
Spring Boot exception handling
Spring Boot Servlet mapping