WebConfigurer.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:flowable-engine 作者:
protected ServletRegistration.Dynamic initSpringRestComponent(ServletContext servletContext, AnnotationConfigWebApplicationContext rootContext,
        String restContextRoot, Class<? extends WebMvcConfigurationSupport> webConfigClass) {

    LOGGER.debug("Configuring Spring Web application context - {} REST", restContextRoot);
    AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
    dispatcherServletConfiguration.setParent(rootContext);
    dispatcherServletConfiguration.register(webConfigClass);

    LOGGER.debug("Registering Spring MVC Servlet - {} REST", restContextRoot);
    ServletRegistration.Dynamic dispatcherServlet = servletContext.addServlet(restContextRoot + "-dispatcher", new DispatcherServlet(dispatcherServletConfiguration));
    dispatcherServlet.addMapping("/" + restContextRoot + "/*");
    dispatcherServlet.setLoadOnStartup(1);
    dispatcherServlet.setAsyncSupported(true);

    return dispatcherServlet;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号