code: public static ApplicationContext createAppContext(Page page) {
          XmlWebApplicationContext appContext = new FrameworkAppContext();
          new AppContextInitializer(page).initialize(appContext);
          appContext.refresh();
          return appContext;
      }
docs: Creates an application context as a child of the root application context and associates it
  with the specified page. In this way, any objects managed by the root application context are
  available to the framework context.
  
  @param page Page for which application context is being created.
  @return New application context