/** * Called by the servlet container to indicate to a servlet that the servlet * is being placed into service. * * @param servletConfig * the object containing the servlet's configuration and * initialization parameters * @throws ServletException * if an exception has occurred that interferes with the * servlet's normal operation. */ @Override public void init(javax.servlet.ServletConfig servletConfig) throws ServletException { CurrentInstance.clearAll(); super.init(servletConfig); try { servletService = createServletService(); } catch (ServiceException e) { throw new ServletException("Could not initialize VaadinServlet", e); } // Sets current service even though there are no request and response servletService.setCurrentInstances(null, null); servletInitialized(); CurrentInstance.clearAll(); }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); // Make self-internal scssCache dirtily accessible try { Field field = VaadinServlet.class.getDeclaredField("scssCache"); field.setAccessible(true); scssCache = (Map<String, Object>) field.get(this); } catch (ReflectiveOperationException e) { log("Unable to initialize reference to inner Scss cache for the Vaadin servlet; caching won't be disabled.", e); } }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); ApplicationContext applicationContext = AppContext.getApplicationContext(); List<BootstrapListener> bootstrapListeners = applicationContext.getBeansOfType(BootstrapListener.class) .values().stream() .sorted(AnnotationAwareOrderComparator.INSTANCE) .collect(Collectors.toList()); getService().addSessionInitListener(event -> bootstrapListeners.forEach(event.getSession()::addBootstrapListener) ); }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); touchKitSettings = new TouchKitSettings(getService()); }
/** * @see com.vaadin.server.VaadinServlet#servletInitialized() */ @Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().setSystemMessagesProvider(this); getService().addSessionInitListener(this); }
servletInitialized(); CurrentInstance.clearAll();
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(event -> event.getSession().addBootstrapListener(this) ); }