spring-framework / org.springframework.web.context.annotation / RequestScope

RequestScope

@Target([AnnotationTarget.CLASS, AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]) @Scope("request") class RequestScope

@RequestScope is a specialization of Scope for a component whose lifecycle is bound to the current web request.

Specifically, @RequestScope is a composed annotation that acts as a shortcut for @Scope("request") with the default #proxyMode set to TARGET_CLASS.

@RequestScope may be used as a meta-annotation to create custom composed annotations.

Author
Sam Brannen

Since
4.3

See Also
SessionScopeApplicationScopeorg.springframework.context.annotation.Scopeorg.springframework.web.context.WebApplicationContext#SCOPE_REQUESTorg.springframework.web.context.request.RequestScopeorg.springframework.stereotype.Componentorg.springframework.context.annotation.Bean

Constructors

<init>

RequestScope(proxyMode: ScopedProxyMode)

@RequestScope is a specialization of Scope for a component whose lifecycle is bound to the current web request.

Specifically, @RequestScope is a composed annotation that acts as a shortcut for @Scope("request") with the default #proxyMode set to TARGET_CLASS.

@RequestScope may be used as a meta-annotation to create custom composed annotations.

Properties

proxyMode

val proxyMode: ScopedProxyMode

Alias for Scope#proxyMode.

Defaults to ScopedProxyMode#TARGET_CLASS.