/** * Unbind the request from the current thread. * @param requestAttributes */ public static void unbindRequest( final PortletRequestAttributes requestAttributes) { if (requestAttributes != null) { requestAttributes.requestCompleted(); } RequestContextHolder.setRequestAttributes(null); LocaleContextHolder.setLocale(null); }
/** * unexpose the request from the current thread * @param request */ public static void unexposeRequest(PortletRequest request) { //use same code as requestDestroyed from Spring RequestContextListener PortletRequestAttributes attributes = (PortletRequestAttributes) request.getAttribute(REQUEST_ATTRIBUTES_ATTRIBUTE); PortletRequestAttributes threadAttributes = (PortletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (threadAttributes != null) { if (attributes == null) { attributes = threadAttributes; } LocaleContextHolder.resetLocaleContext(); RequestContextHolder.resetRequestAttributes(); } if (attributes != null) { attributes.requestCompleted(); } }
if (requestAttributes != null) { RequestContextHolder.setRequestAttributes(previousRequestAttributes, this.threadContextInheritable); requestAttributes.requestCompleted();
if (requestAttributes != null) { RequestContextHolder.setRequestAttributes(previousRequestAttributes, this.threadContextInheritable); requestAttributes.requestCompleted();