`

spring4 零配置启动

阅读更多
引用
@Order(1)
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[] { 。。。};
}

@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[] { 。。。};
}

@Override
protected void customizeRegistration(ServletRegistration.Dynamic registration) {
registration.setInitParameter("throwExceptionIfNoHandlerFound", "true");
}

}


spring4 webconfig通常继承WebMvcConfigurerAdapter
WebMvcConfigurerComposite会调用webconfig中的方法

最终是WebMvcConfigurationSupport
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics