/** * Update all accessed session attributes through {@code session.setAttribute} * calls, explicitly indicating to the container that they might have been modified. */ @Override protected void updateAccessedSessionAttributes() { if (!this.sessionAttributesToUpdate.isEmpty()) { // Update all affected session attributes. HttpSession session = getSession(false); if (session != null) { try { for (Map.Entry<String, Object> entry : this.sessionAttributesToUpdate.entrySet()) { String name = entry.getKey(); Object newValue = entry.getValue(); Object oldValue = session.getAttribute(name); if (oldValue == newValue && !isImmutableSessionAttribute(name, newValue)) { session.setAttribute(name, newValue); } } } catch (IllegalStateException ex) { // Session invalidated - shouldn't usually happen. } } this.sessionAttributesToUpdate.clear(); } }
/** * Update all accessed session attributes through {@code session.setAttribute} * calls, explicitly indicating to the container that they might have been modified. */ @Override protected void updateAccessedSessionAttributes() { if (!this.sessionAttributesToUpdate.isEmpty()) { // Update all affected session attributes. HttpSession session = getSession(false); if (session != null) { try { for (Map.Entry<String, Object> entry : this.sessionAttributesToUpdate.entrySet()) { String name = entry.getKey(); Object newValue = entry.getValue(); Object oldValue = session.getAttribute(name); if (oldValue == newValue && !isImmutableSessionAttribute(name, newValue)) { session.setAttribute(name, newValue); } } } catch (IllegalStateException ex) { // Session invalidated - shouldn't usually happen. } } this.sessionAttributesToUpdate.clear(); } }
/** * Update all accessed session attributes through {@code session.setAttribute} * calls, explicitly indicating to the container that they might have been modified. */ @Override protected void updateAccessedSessionAttributes() { if (!this.sessionAttributesToUpdate.isEmpty()) { // Update all affected session attributes. HttpSession session = getSession(false); if (session != null) { try { for (Map.Entry<String, Object> entry : this.sessionAttributesToUpdate.entrySet()) { String name = entry.getKey(); Object newValue = entry.getValue(); Object oldValue = session.getAttribute(name); if (oldValue == newValue && !isImmutableSessionAttribute(name, newValue)) { session.setAttribute(name, newValue); } } } catch (IllegalStateException ex) { // Session invalidated - shouldn't usually happen. } } this.sessionAttributesToUpdate.clear(); } }
/** * Update all accessed session attributes through {@code session.setAttribute} * calls, explicitly indicating to the container that they might have been modified. */ @Override protected void updateAccessedSessionAttributes() { if (!this.sessionAttributesToUpdate.isEmpty()) { // Update all affected session attributes. HttpSession session = getSession(false); if (session != null) { try { for (Map.Entry<String, Object> entry : this.sessionAttributesToUpdate.entrySet()) { String name = entry.getKey(); Object newValue = entry.getValue(); Object oldValue = session.getAttribute(name); if (oldValue == newValue && !isImmutableSessionAttribute(name, newValue)) { session.setAttribute(name, newValue); } } } catch (IllegalStateException ex) { // Session invalidated - shouldn't usually happen. } } this.sessionAttributesToUpdate.clear(); } }