@Override public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) { HttpSession httpSession = (HttpSession) request.getHttpSession(); org.zkoss.zk.ui.Session sess = SessionsCtrl.getSession(WebApps.getCurrent(), httpSession); config.getUserProperties().put(getClass().getName(), sess); }
/** Called when a HTTP session listener is notified. * <p>Once called the session is cleaned. All desktops are dropped. */ /*package*/ static final void sessionDestroyed(HttpSession hsess) { //Under JBoss, the servlet might be destroyed before this callback final WebManager webman = getWebManagerIfAny(hsess.getServletContext()); if (webman != null) { final WebApp wapp = webman.getWebApp(); final Session sess = SessionsCtrl.getSession(wapp, hsess); if (sess != null) ((WebAppCtrl) wapp).sessionDestroyed(sess); } }
private static final Session getSession(ServletContext ctx, HttpSession hsess, HttpServletRequest request) { final WebApp wapp = getWebManager(ctx).getWebApp(); final Session sess = SessionsCtrl.getSession(wapp, hsess); return sess != null ? sess : SessionsCtrl.newSession(wapp, hsess, request); }
/** Returns the session. */ private Session getSession(Object request, boolean create) throws PortletException { final WebApp wapp = getWebManager().getWebApp(); PortletSession psess = null; if (request instanceof RenderRequest) psess = ((RenderRequest) request).getPortletSession(); else if (request instanceof ResourceRequest) psess = ((ResourceRequest) request).getPortletSession(); Session sess = SessionsCtrl.getSession(wapp, psess); if (sess == null && create) sess = SessionsCtrl.newSession(wapp, psess, request); return sess; }
final HttpSession hsess = ((HttpServletRequest) req).getSession(false); if (hsess != null) { final Session sess = SessionsCtrl.getSession(wapp, hsess); if (sess != null) { tmout = sess.getMaxInactiveInterval();
final Object old = hsess != null ? (wapp = WebManager.getWebAppIfAny(ctx)) != null && (sess = SessionsCtrl.getSession(wapp, hsess)) != null ? I18Ns.setup(sess, request, response, "UTF-8") : I18Ns.setup(hsess, request, response, "UTF-8")