/** * Called when a servlet/portlet completes the service of a request. * This method must be called if {@link #requestEnter} is called * and returns true. This method shall not be called, otherwise. * * @since 3.0.1 */ public static void requestExit(Session sess) { final Integer v = (Integer) sess.getAttribute(ATTR_REQUEST_COUNT); final int i = v != null ? v.intValue() - 1 : 0; sess.setAttribute(ATTR_REQUEST_COUNT, new Integer(i >= 0 ? i : 0)); }
/** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionDidActivate}. */ public void sessionDidActivate(Session sess) { DesktopCache dc = (DesktopCache) sess.getAttribute(ATTR_CACHE); if (dc != null) dc.sessionDidActivate(sess); }
/** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionWillPassivate}. */ public void sessionWillPassivate(Session sess) { DesktopCache dc = (DesktopCache) sess.getAttribute(ATTR_CACHE); if (dc != null) dc.sessionWillPassivate(sess); }
private String getFolderUrl() { String uuid = ((String[])param.get("CKEditor"))[0]; uuid = uuid.substring(0, uuid.lastIndexOf("-cnt")); String url = null; if ("Images".equals(type)) url = (String) session.getAttribute("filebrowserImageBrowseUrl"+ uuid); else if ("Flash".equals(type)) url = (String) session.getAttribute("filebrowserFlashBrowseUrl"+ uuid); if (url == null) url = (String) session.getAttribute("filebrowserBrowseUrl"+ uuid); String updateURI = application.getUpdateURI(); apName = updateURI.substring(0, updateURI.indexOf("/zkau")); int index = url.indexOf(apName); if (index == 0 && apName.length() > 0) index = url.indexOf("/", 1); url = index < 0 ? url: url.substring(index); index = url.lastIndexOf(";jsessionid"); if (index > 0) url = url.substring(0, index); if (application.getResourcePaths(url) == null) throw new UiException("Folder not found: " + url); return url; }
public void cleanup(Execution exec, Execution parent, List errs) throws Exception { Session sess = exec.getSession(); //enforce GAE to write session //enforce Weblogic to sync session if (sess != null) sess.setAttribute(Attributes.ZK_SESSION, sess.getAttribute(Attributes.ZK_SESSION)); }
Object o = null; if (sess != null) { o = sess.getAttribute(Attributes.PREFERRED_FIRST_DAY_OF_WEEK); if (o == null) { final Object hsess = sess.getNativeSession();
public Object getAttribute(String name, boolean recurse) { Object val = getAttribute(name); if (val != null || !recurse || hasAttribute(name)) return val; if (_sess != null) return _sess.getAttribute(name, true); if (_wapp != null) return _wapp.getAttribute(name, true); return null; }
/** Called when a servlet/portlet starts to serve a request. * It checks whether the number of concurrent requests per session * exceeds the number specified in * {@link org.zkoss.zk.ui.util.Configuration#getSessionMaxRequests}. * If exceeded, false is returned, and the servlet/portlet shall stop * processing and return an error code back the client. * * <p>If not exceeded, true is returned, and the servlet/portlet * can continue the processing and it shall invoke {@link #requestExit} * in the finally clause. * * @since 3.0.1 */ public static boolean requestEnter(Session sess) { final Integer v = (Integer) sess.getAttribute(ATTR_REQUEST_COUNT); final int i = v != null ? v.intValue() + 1 : 1; final int max = sess.getWebApp().getConfiguration().getSessionMaxRequests(); if (max < 0 || i <= max) { sess.setAttribute(ATTR_REQUEST_COUNT, new Integer(i)); return true; } return false; }
if (wapp == null || "CE".equals(WebApps.getEdition()) || wapp.getAttribute("org.zkoss.zk.ui.notice") != null) { final PI pi = (PI) sess.getAttribute(ATTR_PI); boolean show = pi == null; if (show)
final Integer icnt = (Integer) _sess.getAttribute(ATTR_PUSH_COUNT); int cnt = icnt != null ? icnt.intValue() : 0; if (enable) {
defaultInst = (String) session.getAttribute(Constants.DEFAULT_INSTITUTION); .getAttribute(org.carewebframework.security.spring.Constants.SAVED_REQUEST);
securityDomainId = (String) session.getAttribute(Constants.DEFAULT_SECURITY_DOMAIN);