/** * @since 2.2 * @param create * @return */ public String getSessionId(boolean create) { ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get(); if (ctx == null) { throw new UnsupportedOperationException(); } return ctx.getSessionId(create); }
String result = ""; if (defaultExternalContext != null) { result = defaultExternalContext.getSessionId(create); } else { throw new UnsupportedOperationException();
/** * <p class="changed_added_2_2">Return the id of the current session * or the empty string if no session has been created and the * <code>create</code> parameter is <code>false</code>.</p> * * <div class="changed_added_2_2"> * * <p><em>Servlet:</em> If <code>create</code> is true, obtain * a reference to the <code>HttpSession</code> for the current request * (creating the session if necessary) and return its id. If * <code>create</code> is <code>false</code>, obtain a reference to the * current session, if one exists, and return its id. If no session exists, * return the empty string.</p> * * </div> * * @since 2.2 * * @param create Flag indicating whether or not a new session should be * created if there is no session associated with the current request */ public String getSessionId(boolean create) { String result = ""; if (defaultExternalContext != null) { result = defaultExternalContext.getSessionId(create); } else { throw new UnsupportedOperationException(); } return result; }
@Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
String result = ""; if (defaultExternalContext != null) { result = defaultExternalContext.getSessionId(create); } else { throw new UnsupportedOperationException();
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#getSessionId(boolean)} * on the wrapped {@link ExternalContext} object.</p> * * @since 2.2 * * @see javax.faces.context.ExternalContext#getSessionId(boolean) */ @Override public String getSessionId(boolean create) { return getWrapped().getSessionId(create); }
private String calculateClientWindow(FacesContext context) { synchronized(context.getExternalContext().getSession(true)) { final String clientWindowCounterKey = "com.sun.faces.lifecycle.ClientWindowCounterKey"; ExternalContext extContext = context.getExternalContext(); Map<String, Object> sessionAttrs = extContext.getSessionMap(); Integer counter = (Integer) sessionAttrs.get(clientWindowCounterKey); if (null == counter) { counter = Integer.valueOf(0); } char sep = UINamingContainer.getSeparatorChar(context); id = extContext.getSessionId(true) + sep + + counter; sessionAttrs.put(clientWindowCounterKey, ++counter); } return id; }
private String calculateClientWindow(FacesContext context) { synchronized(context.getExternalContext().getSession(true)) { final String clientWindowCounterKey = "com.sun.faces.lifecycle.ClientWindowCounterKey"; ExternalContext extContext = context.getExternalContext(); Map<String, Object> sessionAttrs = extContext.getSessionMap(); Integer counter = (Integer) sessionAttrs.get(clientWindowCounterKey); if (null == counter) { counter = Integer.valueOf(0); } char sep = UINamingContainer.getSeparatorChar(context); id = extContext.getSessionId(true) + sep + + counter; sessionAttrs.put(clientWindowCounterKey, ++counter); } return id; }
private String calculateClientWindow(FacesContext context) { synchronized(context.getExternalContext().getSession(true)) { final String clientWindowCounterKey = "com.sun.faces.lifecycle.ClientWindowCounterKey"; ExternalContext extContext = context.getExternalContext(); Map<String, Object> sessionAttrs = extContext.getSessionMap(); Integer counter = (Integer) sessionAttrs.get(clientWindowCounterKey); if (null == counter) { counter = Integer.valueOf(0); } char sep = UINamingContainer.getSeparatorChar(context); id = extContext.getSessionId(true) + sep + + counter; sessionAttrs.put(clientWindowCounterKey, ++counter); } return id; }
private String calculateClientWindow(FacesContext context) { synchronized(context.getExternalContext().getSession(true)) { final String clientWindowCounterKey = "com.sun.faces.lifecycle.ClientWindowCounterKey"; ExternalContext extContext = context.getExternalContext(); Map<String, Object> sessionAttrs = extContext.getSessionMap(); Integer counter = (Integer) sessionAttrs.get(clientWindowCounterKey); if (null == counter) { counter = Integer.valueOf(0); } char sep = UINamingContainer.getSeparatorChar(context); id = extContext.getSessionId(true) + sep + + counter; sessionAttrs.put(clientWindowCounterKey, ++counter); } return id; }
@Override public String getId() { if (id == null) { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); String portletNamespace = ""; ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.getRequestMap().get(WebKeys.THEME_DISPLAY); if (themeDisplay != null) { PortletDisplay portletDisplay = themeDisplay.getPortletDisplay(); portletNamespace = portletDisplay.getNamespace(); } char separatorChar = UINamingContainer.getSeparatorChar(facesContext); String clientWindowCounterKey = CLIENT_WINDOW_COUNTER_KEY + separatorChar + portletNamespace; Object session = externalContext.getSession(true); String sessionId = externalContext.getSessionId(true); Map<String, Object> sessionMap = externalContext.getSessionMap(); synchronized (session) { Integer clientWindowCounter = (Integer) sessionMap.get(clientWindowCounterKey); if (clientWindowCounter == null) { clientWindowCounter = new Integer(0); } id = sessionId + separatorChar + portletNamespace + separatorChar + clientWindowCounter; sessionMap.put(clientWindowCounterKey, ++clientWindowCounter); } } return id; }
@Override public String getId() { if (id == null) { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); String portletNamespace = ""; ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.getRequestMap().get(WebKeys.THEME_DISPLAY); if (themeDisplay != null) { PortletDisplay portletDisplay = themeDisplay.getPortletDisplay(); portletNamespace = portletDisplay.getNamespace(); } char separatorChar = UINamingContainer.getSeparatorChar(facesContext); String clientWindowCounterKey = CLIENT_WINDOW_COUNTER_KEY + separatorChar + portletNamespace; Object session = externalContext.getSession(true); String sessionId = externalContext.getSessionId(true); Map<String, Object> sessionMap = externalContext.getSessionMap(); synchronized (session) { Integer clientWindowCounter = (Integer) sessionMap.get(clientWindowCounterKey); if (clientWindowCounter == null) { clientWindowCounter = new Integer(0); } id = sessionId + separatorChar + portletNamespace + separatorChar + clientWindowCounter; sessionMap.put(clientWindowCounterKey, ++clientWindowCounter); } } return id; }
@Override public String getId() { if (id == null) { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); String portletNamespace = ""; ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.getRequestMap().get(WebKeys.THEME_DISPLAY); if (themeDisplay != null) { PortletDisplay portletDisplay = themeDisplay.getPortletDisplay(); portletNamespace = portletDisplay.getNamespace(); } char separatorChar = UINamingContainer.getSeparatorChar(facesContext); String clientWindowCounterKey = CLIENT_WINDOW_COUNTER_KEY + separatorChar + portletNamespace; Object session = externalContext.getSession(true); String sessionId = externalContext.getSessionId(true); Map<String, Object> sessionMap = externalContext.getSessionMap(); synchronized (session) { Integer clientWindowCounter = (Integer) sessionMap.get(clientWindowCounterKey); if (clientWindowCounter == null) { clientWindowCounter = new Integer(0); } id = sessionId + separatorChar + portletNamespace + separatorChar + clientWindowCounter; sessionMap.put(clientWindowCounterKey, ++clientWindowCounter); } } return id; }