Skip to content

io microsphere spring web util WebServerScope

github-actions[bot] edited this page Jul 11, 2026 · 25 revisions

WebServerScope

Type: Enum | Module: microsphere-spring-webflux | Package: io.microsphere.spring.web.util | Since: 1.0.0

Source: microsphere-spring-webflux/src/main/java/io/microsphere/spring/web/util/WebServerScope.java

Overview

The enumeration of Web Server scopes for Spring Web

Declaration

public enum WebServerScope

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.36-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-spring-webflux</artifactId>
    <version>${microsphere-spring.version}</version>
</dependency>

Tip: Use the BOM (microsphere-spring-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.spring.web.util.WebServerScope;

API Reference

Public Methods

Method Description
value Request Scope
getAttribute Return the request attribute value if present.
setAttribute Set the request attribute value.
removeAttribute Remove the request attribute by the specified name.
getRequiredAttribute Return the request attribute value or if not present raise an
getAttributeOrDefault Return the request attribute value, or a default, fallback value.
getAttributeNames Get all attribute names in the specified ServerWebExchange.
valueOf Resolve the WebServerScope by the specified scope value
getAttribute Get the attribute value by the specified name
setAttribute Set the attribute value
removeAttribute Remove the attribute by the specified name
getAttributeNames Get all attribute names in the specified ServerWebExchange by the scope

Method Details

removeAttribute

public Object removeAttribute(@Nonnull ServerWebExchange serverWebExchange, @Nullable String name)

Remove the request attribute by the specified name.

getRequiredAttribute

public <T> T getRequiredAttribute(@Nonnull ServerWebExchange serverWebExchange, @Nullable String name)

Return the request attribute value or if not present raise an IllegalArgumentException.

getAttributeOrDefault

public <T> T getAttributeOrDefault(@Nonnull ServerWebExchange serverWebExchange, @Nullable String name,
                                       @Nullable T defaultValue)

Return the request attribute value, or a default, fallback value.

getAttributeNames

public String[] getAttributeNames(@Nonnull ServerWebExchange serverWebExchange)

Get all attribute names in the specified ServerWebExchange.

valueOf

public static WebServerScope valueOf(int scope)

Resolve the WebServerScope by the specified scope value

getAttributeNames

public static String[] getAttributeNames(@Nonnull ServerWebExchange serverWebExchange, int scope)

Get all attribute names in the specified ServerWebExchange by the scope

See Also

  • RequestAttributes#SCOPE_REQUEST
  • RequestAttributes#SCOPE_SESSION

This documentation was auto-generated from the source code of microsphere-spring.

Home

spring-context

spring-guice

spring-jdbc

spring-test

spring-web

spring-webflux

spring-webmvc

Clone this wiki locally