parent = (ApplicationContext) object;
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, null);
}
SpringApplicationBuilder application = new SpringApplicationBuilder();
if (parent != null) {
application.initializers(new ParentContextApplicationContextInitializer(parent));
}
application.initializers(new ServletContextApplicationContextInitializer(servletContext));
application.contextClass(AnnotationConfigEmbeddedWebApplicationContext.class);
application = configure(application);
// Ensure error pages are registered