WebInitializer.java 文件源码

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

项目:java_springboot 作者:
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.register(MvcConfig.class);
    context.setServletContext(servletContext);
    ServletRegistration.Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(context));
    servlet.addMapping("/");
    servlet.setLoadOnStartup(1);
    servlet.setAsyncSupported(true);//开启异步方法支持
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号