Skip to content

Commit 9542a50

Browse files
committed
Support Spring Boot 4 WebMvcAutoConfiguration
Update auto-configuration ordering to handle both Spring Boot 2.x and 4.x class names. Added a @see to org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration and expanded @autoConfiguration(afterName=...) to include both the old 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration' (Spring Boot 2) and the new 'org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration' (Spring Boot 4+) so the configuration is applied correctly across SB versions.
1 parent 097d841 commit 9542a50

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

microsphere-spring-boot-webmvc/src/main/java/io/microsphere/spring/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@
4040
*
4141
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
4242
* @see org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
43+
* @see org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration
4344
* @since 1.0.0
4445
*/
4546
@ConditionalOnWebMvcAvailable
46-
@AutoConfiguration(afterName = "org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration")
47+
@AutoConfiguration(afterName = {
48+
"org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration", // Springg Boot [2.0, 4.0)
49+
"org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration" // Spring Boot [4.0,)
50+
})
4751
@EnableWebMvcExtension(registerHandlerInterceptors = true)
4852
@Import(value = {
4953
WebMvcAutoConfiguration.LoggingConfiguration.class

0 commit comments

Comments
 (0)