JavaScript & CSS not running anymore after update to Spring Boot 2.2.x
It is similiar like #8172 but it's in Spring Boot 2.2.7
Comment From: mbhave
@hendisantika Please provide a minimal sample that we can run to reproduce the issue.
Comment From: hendisantika
Oooo.. Sorry for that. Here's the sample https://gitlab.com/hendisantika/spring-boot-security-thymeleaf.
Thanks
Comment From: mbhave
@hendisantika This appears to be happening because of the CustomWebConfig
. When you add @EnableWebMvc
in your application it causes Spring Boot's WebMvcAutoConfiguration
to back off entirely. It doesn't seem like you need to add that annotation or the custom web configuration since static locations will be configured by the WebMvcAutoConfiguration
.
Can you try removing CustomWebConfig
to see if that works for you?
Comment From: hendisantika
OK. Let me try first @mbhave
Comment From: hendisantika
OK. Its working now after I remove CustomWebConfig Class. So We don't need that anymore in Spring Boot 2.2x @mbhave ?
Comment From: mbhave
AFAIK, nothing has changed in this regard for Spring Boot 2.2.x. Adding @EnableWebMvc
is generally not required and if added it means that the user wants to take complete control of their MVC configuration.
If you have any more questions, please join us on Gitter.
Comment From: hendisantika
OIC.
Thank You @mbhave.