@Override public String getSessionId() { Object session = getExternalContext().getSession(true); try { // HttpSession has a getId() method. Method getIdMethod = session.getClass().getMethod("getId"); return String.valueOf(ReflectionUtils.invokeMethod(getIdMethod, session)); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Session object [" + session + "] does not have a getId() method"); } }
/** * Return the JSF attribute Map for the specified scope. * @param scope constant indicating request or session scope * @return the Map representation of the attributes in the specified scope * @see #SCOPE_REQUEST * @see #SCOPE_SESSION */ protected Map<String, Object> getAttributeMap(int scope) { if (scope == SCOPE_REQUEST) { return getExternalContext().getRequestMap(); } else { return getExternalContext().getSessionMap(); } }
@Override public Object getSessionMutex() { // Enforce presence of a session first to allow listeners to create the mutex attribute ExternalContext externalContext = getExternalContext(); Object session = externalContext.getSession(true); Object mutex = externalContext.getSessionMap().get(WebUtils.SESSION_MUTEX_ATTRIBUTE); if (mutex == null) { mutex = (session != null ? session : externalContext); } return mutex; }
@Override public String getSessionId() { Object session = getExternalContext().getSession(true); try { // HttpSession has a getId() method. Method getIdMethod = session.getClass().getMethod("getId"); return String.valueOf(ReflectionUtils.invokeMethod(getIdMethod, session)); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Session object [" + session + "] does not have a getId() method"); } }
/** * Return the JSF attribute Map for the specified scope. * @param scope constant indicating request or session scope * @return the Map representation of the attributes in the specified scope * @see #SCOPE_REQUEST * @see #SCOPE_SESSION */ protected Map<String, Object> getAttributeMap(int scope) { if (scope == SCOPE_REQUEST) { return getExternalContext().getRequestMap(); } else { return getExternalContext().getSessionMap(); } }
@Override public Object resolveReference(String key) { if (REFERENCE_REQUEST.equals(key)) { return getExternalContext().getRequest(); return getExternalContext().getSession(true); return getExternalContext().getContext(); return getExternalContext().getRequestMap(); return getExternalContext().getSessionMap(); return getExternalContext().getApplicationMap(); return getExternalContext().getRequestCookieMap(); return getExternalContext().getRequestHeaderMap(); return getExternalContext().getRequestHeaderValuesMap(); return getExternalContext().getRequestParameterMap(); return getExternalContext().getRequestParameterValuesMap(); return getExternalContext().getInitParameterMap(); return getExternalContext().getFlash();
@Override public Object getSessionMutex() { // Enforce presence of a session first to allow listeners to create the mutex attribute ExternalContext externalContext = getExternalContext(); Object session = externalContext.getSession(true); Object mutex = externalContext.getSessionMap().get(WebUtils.SESSION_MUTEX_ATTRIBUTE); if (mutex == null) { mutex = (session != null ? session : externalContext); } return mutex; }
@Override public Object resolveReference(String key) { if (REFERENCE_REQUEST.equals(key)) { return getExternalContext().getRequest(); return getExternalContext().getSession(true); return getExternalContext().getContext(); return getExternalContext().getRequestMap(); return getExternalContext().getSessionMap(); return getExternalContext().getApplicationMap(); return getExternalContext().getRequestCookieMap(); return getExternalContext().getRequestHeaderMap(); return getExternalContext().getRequestHeaderValuesMap(); return getExternalContext().getRequestParameterMap(); return getExternalContext().getRequestParameterValuesMap(); return getExternalContext().getInitParameterMap(); return getExternalContext().getFlash();
@Override public String getSessionId() { Object session = getExternalContext().getSession(true); try { // HttpSession has a getId() method. Method getIdMethod = session.getClass().getMethod("getId"); return String.valueOf(ReflectionUtils.invokeMethod(getIdMethod, session)); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Session object [" + session + "] does not have a getId() method"); } }
@Override public String getSessionId() { Object session = getExternalContext().getSession(true); try { // Both HttpSession and PortletSession have a getId() method. Method getIdMethod = session.getClass().getMethod("getId"); return String.valueOf(ReflectionUtils.invokeMethod(getIdMethod, session)); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Session object [" + session + "] does not have a getId() method"); } }
/** * Return the JSF attribute Map for the specified scope. * @param scope constant indicating request or session scope * @return the Map representation of the attributes in the specified scope * @see #SCOPE_REQUEST * @see #SCOPE_SESSION */ protected Map<String, Object> getAttributeMap(int scope) { if (scope == SCOPE_REQUEST) { return getExternalContext().getRequestMap(); } else { return getExternalContext().getSessionMap(); } }
/** * Return the JSF attribute Map for the specified scope * @param scope constant indicating request or session scope * @return the Map representation of the attributes in the specified scope * @see #SCOPE_REQUEST * @see #SCOPE_SESSION */ protected Map<String, Object> getAttributeMap(int scope) { if (scope == SCOPE_REQUEST) { return getExternalContext().getRequestMap(); } else { return getExternalContext().getSessionMap(); } }
@Override public Object getSessionMutex() { // Enforce presence of a session first to allow listeners to create the mutex attribute ExternalContext externalContext = getExternalContext(); Object session = externalContext.getSession(true); Object mutex = externalContext.getSessionMap().get(WebUtils.SESSION_MUTEX_ATTRIBUTE); if (mutex == null) { mutex = (session != null ? session : externalContext); } return mutex; }
@Override public Object getSessionMutex() { // Enforce presence of a session first to allow listeners to create the mutex attribute ExternalContext externalContext = getExternalContext(); Object session = externalContext.getSession(true); Object mutex = externalContext.getSessionMap().get(WebUtils.SESSION_MUTEX_ATTRIBUTE); if (mutex == null) { mutex = (session != null ? session : externalContext); } return mutex; }
@Override public Object resolveReference(String key) { if (REFERENCE_REQUEST.equals(key)) { return getExternalContext().getRequest(); return getExternalContext().getSession(true); return getExternalContext().getContext(); return getExternalContext().getRequestMap(); return getExternalContext().getSessionMap(); return getExternalContext().getApplicationMap(); return getExternalContext().getRequestCookieMap(); return getExternalContext().getRequestHeaderMap(); return getExternalContext().getRequestHeaderValuesMap(); return getExternalContext().getRequestParameterMap(); return getExternalContext().getRequestParameterValuesMap(); return getExternalContext().getInitParameterMap(); return getExternalContext().getFlash();
@Override public Object resolveReference(String key) { if (REFERENCE_REQUEST.equals(key)) { return getExternalContext().getRequest(); return getExternalContext().getSession(true); return getExternalContext().getContext(); return getExternalContext().getRequestMap(); return getExternalContext().getSessionMap(); return getExternalContext().getApplicationMap(); return getExternalContext().getRequestCookieMap(); return getExternalContext().getRequestHeaderMap(); return getExternalContext().getRequestHeaderValuesMap(); return getExternalContext().getRequestParameterMap(); return getExternalContext().getRequestParameterValuesMap(); return getExternalContext().getInitParameterMap(); return getExternalContext().getFlash();