Example usage for org.springframework.web.context.request.async AsyncWebRequest removeAttribute

List of usage examples for org.springframework.web.context.request.async AsyncWebRequest removeAttribute

Introduction

In this page you can find the example usage for org.springframework.web.context.request.async AsyncWebRequest removeAttribute.

Prototype

void removeAttribute(String name, int scope);

Source Link

Document

Remove the scoped attribute of the given name, if it exists.

Usage

From source file:org.springframework.web.context.request.async.WebAsyncManager.java

/**
 * Configure the {@link AsyncWebRequest} to use. This property may be set
 * more than once during a single request to accurately reflect the current
 * state of the request (e.g. following a forward, request/response
 * wrapping, etc). However, it should not be set while concurrent handling
 * is in progress, i.e. while {@link #isConcurrentHandlingStarted()} is
 * {@code true}.//from  ww w.java  2  s.  com
 * @param asyncWebRequest the web request to use
 */
public void setAsyncWebRequest(final AsyncWebRequest asyncWebRequest) {
    Assert.notNull(asyncWebRequest, "AsyncWebRequest must not be null");
    this.asyncWebRequest = asyncWebRequest;
    this.asyncWebRequest.addCompletionHandler(() -> asyncWebRequest
            .removeAttribute(WebAsyncUtils.WEB_ASYNC_MANAGER_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST));
}