Spring 梳理 - 开启并配置 Spring MVC 的方法

  1. 传统web.xm中配置两个上下文+两个context对应的xml+两个上下文bean分别手动配置
  2. 传统web.xm中配置两个上下文+两个context对应的xml+<mvc:annotation-driven />+ComponentScan
  3. 基于Servlet容器的SCI,继承AbstractAnnotationConfigDispatcherServletInitializer  或  WebApplicationInitializer
  4. 基于javaconfig+@EnableWebMvc+WebMvcConfigurerAdapter

 

参考本人另外一篇文章  SPI/SCI/SpringSCI/WebApplicationInitializer/WebMvcConfigurerAdapter

posted on 2019-01-05 23:01  手握太阳  阅读(153)  评论(0编辑  收藏  举报

导航