zoukankan      html  css  js  c++  java
  • 在SpringBoot2.0及Spring 5.0 WebMvcConfigurerAdapter已被废弃,目前找到解决方案就有两种

    在SpringBoot2.0及Spring 5.0 WebMvcConfigurerAdapter已被废弃,目前找到解决方案就有两种

    1 直接实现WebMvcConfigurer (官方推荐)

    例如:

    @Configuration
    public class WebMvcConfg implements WebMvcConfigurer {

    //todo

    }

    2 直接继承WebMvcConfigurationSupport

    例如:

    @Configuration
    public class WebMvcConfg extends WebMvcConfigurationSupport {

    //todo

    }

    —–2018.04.17—-
    今天查了下官方api
    Deprecated.
    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
    An implementation of WebMvcConfigurer with empty methods allowing subclasses to override only the methods they’re interested in.
    因此推荐第一种方式
    ---------------------
    作者:cormye
    来源:CSDN
    原文:https://blog.csdn.net/lenkvin/article/details/79482205
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    JS——祝愿墙
    JS——模拟百度搜索
    JS——选择水果
    html——快捷键
    JS——百度背景图
    JS——stye属性
    JS——高级各行换色
    html——细线表格
    LeetCode初级算法(数组)解答
    Python网络爬虫(四)
  • 原文地址:https://www.cnblogs.com/telwanggs/p/10802011.html
Copyright © 2011-2022 走看看