How ContextLoaderListner loads XML file for Applic

2019-08-25 02:31发布

In Non-Webapplication, We use Classpath,fileSystem or other Implementations of ApplicationContext. In web app if we implement Java Configuration then we do it like this.

  @Override
public void onStartup(ServletContext servletCxt) {

    // Load Spring web application configuration
    AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext();
    ac.register(AppConfig.class);
    ac.refresh();

But when we load Application context xml with ContextLoaderListner what is the implemention internaly.

I hope i made the point.

0条回答
登录 后发表回答