WebMvcConfigurerAdapter @deprecated 弃用

位置:首页>文章>详情   分类: 教程分享 > Java教程   阅读(3314)   2023-03-28 11:29:14
SPRING 5.0

Spring MVC 5.0 框架中,弃用了
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter

WebMvcConfigurerAdapter 推荐使用以下两种方式替用

方式一:继承org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport

例如:
 

@Configuration
public class WebMvcConfg extends WebMvcConfigurationSupport {

        //你的其他配置,重写方法后配置

}

方式二:直接实现接口org.springframework.web.servlet.config.annotation.WebMvcConfigurer

例如:
@Configuration
public class WebMvcConfg implements WebMvcConfigurer {

    //你的具体实现及配置

}

 
地址:https://www.leftso.com/article/720.html

相关阅读

java编程中spring框架5.0介绍说明/概述,spring5,spring框架,java编程
Spring框架5.0,spring mvc 5.0入门教程。DispatcherServlet的详细讲解配置以及spring mvc5.0的helloword程序
Spring框架每个版本的特性及历史介绍,从Spring框架开始1.0到最新的Spring 5.0进行讲解整个Spring生涯中的演变过程以及spring框架生态的扩展。
spring boot 2.0 security 5.0 整合,实现自定义表单登录。spring boot 2.0框架使用。
Spring WebFlux,spring框架5.0将会新增的web增强框架,这里主要讲述什么是Spring WebFlux以及Spring WebFlux的新功能,Spring WebFlux...
​Spring MVC 5.0 框架中,弃用了org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapterW...
Spring Boot 2.0 Redis整合,通过spring boot 2.0整合Redis作为spring缓存框架的实现。
spring boot 1.5整合redis实现spring的缓存框架,spring boot,redis
Spring Boot 2.0,Spring框架的Spring Boot 中的Spring Boot Actuator变化讲解。并且了解如何在Spring Boot 2.0中使用Actuator...
Spring 5 入门实战Say Hello,本博客主要讲解spring 5最基础的容器入门实战。