@Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); getService().addSessionInitListener((SessionInitEvent event) -> { try { onVaadinSessionStarted(event.getRequest(), event.getSession()); } catch (ServletException e) { throw new ServiceException(e); } }); }
@Override public void init(ServletConfig config) throws ServletException { applicationContext = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext()); if (config.getInitParameter(CONTEXT_CONFIG_LOCATION_PARAMETER) != null) { XmlWebApplicationContext context = new XmlWebApplicationContext(); context.setParent(applicationContext); context.setConfigLocation(config.getInitParameter(CONTEXT_CONFIG_LOCATION_PARAMETER)); context.setServletConfig(config); context.setServletContext(config.getServletContext()); context.refresh(); applicationContext = context; } if (config.getInitParameter(SYSTEM_MESSAGES_BEAN_NAME_PARAMETER) != null) { systemMessagesBeanName = config.getInitParameter(SYSTEM_MESSAGES_BEAN_NAME_PARAMETER); logger.debug("found SYSTEM_MESSAGES_BEAN_NAME_PARAMETER: {}", systemMessagesBeanName); } if (SpringApplicationContext.getApplicationContext() == null) { SpringApplicationContext.setApplicationContext(applicationContext); } super.init(config); }
@Override public void init(ServletConfig servletConfig) throws ServletException { if (!initialized) { Configuration configuration = AppBeans.get(Configuration.NAME); webConfig = configuration.getConfig(WebConfig.class); statisticsCounter = AppBeans.get(WebStatisticsAccumulator.class); resources = AppBeans.get(Resources.class); if (configuration.getConfig(GlobalConfig.class).getPerformanceTestMode()) { System.setProperty(getPackageName() + ".disable-xsrf-protection", "true"); } super.init(servletConfig); initialized = true; } }
@Override public void init() throws ServletException { super.init();