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.
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.
** 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
Thymeleaf's own Dialect is also an error!
Recommended Posts