}
} else {
applicationContext = new GenericApplicationContext();
}
ManagedBeanFactory managedBeanFactory = applicationContext.getManagedBeanFactory();
applicationContext.setAttribute(ApplicationContext.CONTEXT_PATH,
servletContextEvent.getServletContext().getContextPath());
applicationContext.setAttribute(ApplicationContext.SETTINGS_JSONP, settings.jsonpSupport());
applicationContext.setAttribute(ApplicationContext.SETTINGS_ADMIN_USER, settings.sherpaAdmin());
applicationContext.setAttribute(ApplicationContext.SETTINGS_ENDPOINT_AUTH, settings.endpointAuthenication());
applicationContext.setAttribute(StringParamParser.DEFAULT, settings.encoding());
applicationContext.setAttribute(DateParamParser.DEFAULT, settings.dateFormat());
applicationContext.setAttribute(CalendarParamParser.DEFAULT, settings.dateFormat());
// Settings
applicationContext.setAttribute(SherpaSettings.SETTINGS_SERVER_URL, settings.serverUrl());
applicationContext.setAttribute(SherpaSettings.SETTINGS_SERVER_TOKEN, settings.serverToken());
if(InitManageBeanFactory.class.isAssignableFrom(managedBeanFactory.getClass())) {
((InitManageBeanFactory)managedBeanFactory).init(settings, servletContextEvent.getServletContext());
((InitManageBeanFactory)managedBeanFactory).loadManagedBeans(settings.endpoint());
}