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

猜你喜欢

转载自zhangchengtest.iteye.com/blog/2198760