Package org.springframework.web.context.request

# Class RequestScope

java.lang.Object
org.springframework.web.context.request.AbstractRequestAttributesScope
org.springframework.web.context.request.RequestScope

All Implemented Interfaces:
  `org.springframework.beans.factory.config.Scope`

public class RequestScope extends AbstractRequestAttributesScope
Request-backed `Scope` implementation.

Relies on a thread-bound `RequestAttributes` instance, which can be exported through `RequestContextListener`, `RequestContextFilter` or `org.springframework.web.servlet.DispatcherServlet`.

Since:
  2.0
Author:
  Rod Johnson, Juergen Hoeller, Rob Harrop
See Also:
  - `RequestContextHolder.currentRequestAttributes()`
  - `RequestAttributes.SCOPE_REQUEST`
  - `RequestContextListener`
  - `RequestContextFilter`
  - `org.springframework.web.servlet.DispatcherServlet`

## Constructor Summary

Constructors
Constructor
Description
`RequestScope()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getConversationId()`
There is no conversation id concept for a request, so this method returns `null`.
`protected int`
`getScope()`
Template method that determines the actual target scope.

### Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributesScope

`get, registerDestructionCallback, remove, resolveContextualObject`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RequestScope

public RequestScope()

## Method Details

### getScope

protected int getScope()
Description copied from class: `AbstractRequestAttributesScope`
Template method that determines the actual target scope.

Specified by:
  `getScope` in class `AbstractRequestAttributesScope`
Returns:
  the target scope, in the form of an appropriate `RequestAttributes` constant
See Also:
  - `RequestAttributes.SCOPE_REQUEST`
  - `RequestAttributes.SCOPE_SESSION`

### getConversationId

@Nullable public String getConversationId()
There is no conversation id concept for a request, so this method returns `null`.