@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(new SessionInitListener() { /** * */ private static final long serialVersionUID = -8279023207169735541L; @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addUIProvider(uiProvider); } }); }
@Override protected void portletInitialized() throws PortletException { getService().addSessionInitListener(new SessionInitListener() { private static final long serialVersionUID = -4571879262155039969L; @Override public void sessionInit(SessionInitEvent event) throws ServiceException { try { ApplicationContext context = PortletApplicationContextUtils .getRequiredWebApplicationContext(getPortletContext()); SpringAwareUIProvider uiProvider = new SpringAwareUIProvider(context); event.getSession().addUIProvider(uiProvider); } catch (IllegalStateException e) { throw new ServiceException(e); } } }); }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(new SessionInitListener() { /** * */ private static final long serialVersionUID = 1L; @Override public void sessionInit(SessionInitEvent event) { // event.getSession().addBootstrapListener(new // BootstrapListener()); } }); }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); HeaderTagHandler.init(getService()); getService().addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addRequestHandler(new RequestHandler() { @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { String pathInfo = request.getPathInfo(); InputStream in = null; if (pathInfo.endsWith("sw.js")) { response.setContentType("application/javascript"); in = getClass().getResourceAsStream("/sw.js"); } if (in != null) { OutputStream out = response.getOutputStream(); IOUtils.copy(in, out); in.close(); out.close(); return true; } else { return false; } } }); } }); }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addBootstrapListener(bootstrapListener); } }); }
@Override protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException { VaadinServletService servletService = super.createServletService(deploymentConfiguration); servletService.addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent sessionInitEvent) throws ServiceException { sessionInitEvent.getSession().addUIProvider(provider); } }); return servletService; }
@Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addUIProvider(uiProvider); } }); }
public HolonVaadinServletAutoConfiguration(ObjectProvider<List<SessionInitListener>> sessionInitListeners, ObjectProvider<List<SessionDestroyListener>> sessionDestroyListeners) { this.sessionInitListeners = sessionInitListeners.getIfAvailable(); this.sessionDestroyListeners = sessionDestroyListeners.getIfAvailable(); }
/** * Add a {@link SessionInitListener} to be registered at servlet initialization. * @param listener The {@link SessionInitListener} to add */ public void addSessionInitListener(SessionInitListener listener) { if (listener != null) { sessionInitListeners.add(listener); } }