}
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
application.sources(ErrorFilter.class);
return (WebApplicationContext) application.run();