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 {

    //你的具体实现及配置

}

 

评论区域

评论功能已关闭. 提示:评论功能虽已关闭,关闭之前的评论仍然会展示。