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.