@Override @Nullable public Object remove(String name) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); Object scopedObject = attributes.getAttribute(name, getScope()); if (scopedObject != null) { attributes.removeAttribute(name, getScope()); return scopedObject; } else { return null; } }
@Override @Nullable public Object remove(String name) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); Object scopedObject = attributes.getAttribute(name, getScope()); if (scopedObject != null) { attributes.removeAttribute(name, getScope()); return scopedObject; } else { return null; } }
public void removeAttribute(RequestAttributes request, String name) { request.removeAttribute(name, RequestAttributes.SCOPE_SESSION); } }
/** * Remove the scoped attribute of the given name for a given scope, if it exists. * @param name * @param scope */ private static void removeContextAttribute( final String name, final int scope) { getContextAttributes().removeAttribute(name, scope); }
public static void removeSession(String name) { log.debug("removeSession -- Thread id :{}, name : {}", Thread.currentThread().getId(), Thread.currentThread().getName()); getRequestAttributes().removeAttribute(name, RequestAttributes.SCOPE_SESSION); }
@Override public void clearDefaultLocationForCurrentUser() { _currentUserService.clearDefaultLocation(); RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); attributes.removeAttribute(KEY_DEFAULT_SEARCH_LOCATION_FOR_SESSSION, RequestAttributes.SCOPE_SESSION); } }
/** * Notify about leaving this context. * @param webAppContext The current web application context. * @param handle The returned handle from {@link #enteringContext(WebApplicationContext)}. */ public static void leavingContext(WebApplicationContext webAppContext, Object handle) { if (!(handle instanceof ContextInfo)) { throw new IllegalArgumentException("Handle must be an instance of ContextInfo and not " + handle); } final ContextInfo info = (ContextInfo) handle; // get request attributes final RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); // restore class loader and previous web application context Thread.currentThread().setContextClassLoader(info.classLoader); if (info.webAppContext == null) { attributes.removeAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST); } else { attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, info.webAppContext, RequestAttributes.SCOPE_REQUEST); } }
@Override public void clearDefaultLocationForCurrentUser() { _currentUserService.clearDefaultLocation(); RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); attributes.removeAttribute(KEY_DEFAULT_SEARCH_LOCATION_FOR_SESSSION, RequestAttributes.SCOPE_SESSION); } }
if (attributes != null) { attributes.removeAttribute(this.attributeName, RequestAttributes.SCOPE_REQUEST);
@Override @Nullable public Object remove(String name) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); Object scopedObject = attributes.getAttribute(name, getScope()); if (scopedObject != null) { attributes.removeAttribute(name, getScope()); return scopedObject; } else { return null; } }
@Override @Nullable public Object remove(String name) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); Object scopedObject = attributes.getAttribute(name, getScope()); if (scopedObject != null) { attributes.removeAttribute(name, getScope()); return scopedObject; } else { return null; } }