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 {
//你的具体实现及配置
}
版权所有 © 【代码谷】 欢迎非商用转载,转载请按下面格式注明出处,商业转载请联系授权,违者必究。(提示:点击下方内容复制出处)
源文:《WebMvcConfigurerAdapter @deprecated 弃用》,链接:https://www.daimagu.com/article/720.html,来源:【代码谷】
评论