-
Notifications
You must be signed in to change notification settings - Fork 39
io microsphere spring web util RequestAttributesUtils
Type: Class | Module: microsphere-spring-web | Package: io.microsphere.spring.web.util | Since: 1.0.0
Source:
microsphere-spring-web/src/main/java/io/microsphere/spring/web/util/RequestAttributesUtils.java
RequestAttributes Utilities Class
public abstract class RequestAttributesUtilsAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.2.36-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-web</artifactId>
<version>${microsphere-spring.version}</version>
</dependency>Tip: Use the BOM (
microsphere-spring-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.spring.web.util.RequestAttributesUtils;| Method | Description |
|---|---|
setRequestAttribute |
The prefix of the attribute name of the HandlerMethod method parameter |
getRequestAttribute |
Get an attribute from the RequestAttributes with the specified name. |
setHandlerMethodRequestBodyArgument |
Set the RequestBody @RequestBody method parameter in HandlerMethod to the RequestAttributes
|
setHandlerMethodRequestBodyArgument |
Set the RequestBody @RequestBody method parameter in HandlerMethod to the RequestAttributes
|
getHandlerMethodRequestBodyArgument |
Gets the RequestBody @RequestBody method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodRequestBodyArgument |
Gets the RequestBody @RequestBody method parameter from the RequestAttributes
|
getHandlerMethodRequestBodyArgument |
Gets the RequestBody @RequestBody method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodRequestBodyArgument |
Gets the RequestBody @RequestBody method parameter from the RequestAttributes
|
getHandlerMethodArguments |
Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodArguments |
Gets the HandlerMethod method parameter |
getHandlerMethodArguments |
Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodArguments |
Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodArguments |
Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodArguments |
Gets the HandlerMethod method parameter |
setHandlerMethodReturnValue |
Set the HandlerMethod method return value to the RequestContextHolder#getRequestAttributes()
|
setHandlerMethodReturnValue |
Set the HandlerMethod method return value to the RequestAttributes
|
getHandlerMethodReturnValue |
Gets the value returned by the HandlerMethod method from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodReturnValue |
Gets the value returned by the HandlerMethod method |
getHandlerMethodReturnValue |
Gets the value returned by the HandlerMethod method from the RequestContextHolder#getRequestAttributes()
|
getHandlerMethodReturnValue |
Gets the value returned by the HandlerMethod method |
public static void setRequestAttribute(@Nonnull RequestAttributes requestAttributes, @Nullable String attributeName,
@Nullable Object attributeValue)The prefix of the attribute name of the HandlerMethod method parameter
/
public static final String HANDLER_METHOD_ARGUMENTS_ATTRIBUTE_NAME_PREFIX = "HM.ARGS:";
/**
The prefix of the attribute name of the HandlerMethod method parameter annotated ResponseBody
/
public static final String HANDLER_METHOD_REQUEST_BODY_ARGUMENT_ATTRIBUTE_NAME_PREFIX = "HM.RB.ARG:";
/**
The prefix of the attribute name of the HandlerMethod method return value
/
public static final String HANDLER_METHOD_RETURN_VALUE_ATTRIBUTE_NAME_PREFIX = "HM.RV:";
/**
Set an attribute to the RequestAttributes with the specified name and value.
public static <T> T getRequestAttribute(@Nonnull RequestAttributes requestAttributes, String attributeName)Get an attribute from the RequestAttributes with the specified name.
public static void setHandlerMethodRequestBodyArgument(Method method, Object requestBodyArgument)Set the RequestBody @RequestBody method parameter in HandlerMethod to the RequestAttributes
public static void setHandlerMethodRequestBodyArgument(RequestAttributes requestAttributes, Method method, Object requestBodyArgument)Set the RequestBody @RequestBody method parameter in HandlerMethod to the RequestAttributes
public static <T> T getHandlerMethodRequestBodyArgument(HandlerMethod handlerMethod)Gets the RequestBody @RequestBody method parameter from the RequestContextHolder#getRequestAttributes()
public static <T> T getHandlerMethodRequestBodyArgument(RequestAttributes requestAttributes, HandlerMethod handlerMethod)Gets the RequestBody @RequestBody method parameter from the RequestAttributes
public static <T> T getHandlerMethodRequestBodyArgument(Method method)Gets the RequestBody @RequestBody method parameter from the RequestContextHolder#getRequestAttributes()
public static <T> T getHandlerMethodRequestBodyArgument(RequestAttributes requestAttributes, Method method)Gets the RequestBody @RequestBody method parameter from the RequestAttributes
public static Object[] getHandlerMethodArguments(HandlerMethod handlerMethod)Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
public static Object[] getHandlerMethodArguments(MethodParameter parameter)Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
public static Object[] getHandlerMethodArguments(RequestAttributes requestAttributes, MethodParameter parameter)Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
public static Object[] getHandlerMethodArguments(Method method)Gets the HandlerMethod method parameter from the RequestContextHolder#getRequestAttributes()
public static void setHandlerMethodReturnValue(Method method, Object returnValue)Set the HandlerMethod method return value to the RequestContextHolder#getRequestAttributes()
public static void setHandlerMethodReturnValue(RequestAttributes requestAttributes, Method method, Object returnValue)Set the HandlerMethod method return value to the RequestAttributes
public static <T> T getHandlerMethodReturnValue(HandlerMethod handlerMethod)Gets the value returned by the HandlerMethod method from the RequestContextHolder#getRequestAttributes()
public static <T> T getHandlerMethodReturnValue(RequestAttributes requestAttributes, HandlerMethod handlerMethod)Gets the value returned by the HandlerMethod method
public static <T> T getHandlerMethodReturnValue(Method method)Gets the value returned by the HandlerMethod method from the RequestContextHolder#getRequestAttributes()
public static <T> T getHandlerMethodReturnValue(RequestAttributes requestAttributes, Method method)Gets the value returned by the HandlerMethod method
RequestAttributesUtils
This documentation was auto-generated from the source code of microsphere-spring.
spring-context
- AbstractInjectionPointDependencyResolver
- AbstractSmartLifecycle
- AbstractSpringResourceURLConnection
- AnnotatedBeanCapableImportBeanDefinitionRegistrar
- AnnotatedBeanCapableImportCandidate
- AnnotatedBeanCapableImportSelector
- AnnotatedBeanDefinitionRegistryUtils
- AnnotatedInjectionBeanPostProcessor
- AnnotatedInjectionPointDependencyResolver
- AnnotatedPropertySourceLoader
- AnnotationBeanDefinitionRegistryPostProcessor
- AnnotationUtils
- ApplicationContextUtils
- ApplicationEventInterceptor
- ApplicationEventInterceptorChain
- ApplicationListenerInterceptor
- ApplicationListenerInterceptorChain
- AutoRegistrationBean
- AutoRegistrationBeanInitializer
- AutoRegistrationBeanRegistrar
- AutowireCandidateResolvingListener
- AutowiredInjectionPointDependencyResolver
- BeanCapableImportCandidate
- BeanDefinitionUtils
- BeanDependencyResolver
- BeanFactoryListener
- BeanFactoryListenerAdapter
- BeanFactoryListeners
- BeanFactoryUtils
- BeanListener
- BeanListenerAdapter
- BeanListeners
- BeanMethodInjectionPointDependencyResolver
- BeanPropertyChangedEvent
- BeanRegistrar
- BeanSource
- BeanTimeStatistics
- BeanUtils
- CollectingConfigurationPropertyListener
- CompositeAutowireCandidateResolvingListener
- ConfigurableApplicationContextInitializer
- ConfigurationBeanAliasGenerator
- ConfigurationBeanBinder
- ConfigurationBeanBindingPostProcessor
- ConfigurationBeanBindingRegistrar
- ConfigurationBeanBindingsRegister
- ConfigurationBeanCustomizer
- ConfigurationPropertyOverrideAnnotationAttributesStrategy
- ConfigurationPropertyRepository
- ConstructionInjectionPointDependencyResolver
- ConversionServiceResolver
- ConversionServiceUtils
- DefaultApplicationEventInterceptorChain
- DefaultApplicationListenerInterceptorChain
- DefaultBeanDependencyResolver
- DefaultConfigurationBeanAliasGenerator
- DefaultConfigurationBeanBinder
- DefaultPropertiesPropertySource
- DefaultPropertiesPropertySourceLoader
- DefaultPropertiesPropertySources
- DefaultPropertiesPropertySourcesLoader
- DefaultResourceComparator
- DelegatingFactoryBean
- Dependency
- DependencyAnalysisBeanFactoryListener
- DependencyTreeWalker
- EnableAutoRegistrationBean
- EnableConfigurationBeanBinding
- EnableConfigurationBeanBindings
- EnableEventExtension
- EnableSpringConverterAdapter
- EnableSpringConverterAdapterRegistrar
- EnableTTLCaching
- EnvironmentEnabled
- EnvironmentListener
- EnvironmentUtils
- EventExtensionAttributes
- EventExtensionRegistrar
- EventPublishingBeanAfterProcessor
- EventPublishingBeanBeforeProcessor
- EventPublishingBeanInitializer
- ExposingClassPathBeanDefinitionScanner
- FilterMode
- GenericAnnotationAttributes
- GenericApplicationListenerAdapter
- GenericBeanNameGenerator
- GenericBeanPostProcessorAdapter
- HyphenAliasGenerator
- ImmutableMapPropertySource
- ImportOptional
- ImportOptionalSelector
- InjectionPointDependencyResolver
- InjectionPointDependencyResolvers
- InterceptingApplicationEventMulticaster
- InterceptingApplicationEventMulticasterProxy
- InterceptingApplicationListener
- JavaBeansPropertyChangeListenerAdapter
- JoinAliasGenerator
- JsonPropertySource
- JsonPropertySourceFactory
- ListenableAutowireCandidateResolver
- ListenableAutowireCandidateResolverInitializer
- ListenableConfigurableEnvironment
- ListenableConfigurableEnvironmentInitializer
- LoggingAutowireCandidateResolvingListener
- LoggingBeanFactoryListener
- LoggingBeanListener
- LoggingEnvironmentListener
- LoggingSmartLifecycle
- MethodParameterUtils
- MimeTypeUtils
- NamedBeanHolderComparator
- OnceApplicationContextEventListener
- OverrideAnnotationAttributes
- OverrideAnnotationAttributesStrategy
- ParallelPreInstantiationSingletonsBeanFactoryListener
- ProfileListener
- PropertiesUtils
- PropertyConstants
- PropertyResolverListener
- PropertyResolverUtils
- PropertySourceChangedEvent
- PropertySourceExtension
- PropertySourceExtensionAttributes
- PropertySourceExtensionLoader
- PropertySourcesChangedEvent
- PropertySourcesUtils
- PropertyValuesUtils
- ResolvableDependencyTypeFilter
- ResolvablePlaceholderAnnotationAttributes
- ResourceInjectionPointDependencyResolver
- ResourceLoaderUtils
- ResourcePropertySource
- ResourcePropertySourceLoader
- ResourcePropertySources
- ResourcePropertySourcesLoader
- ResourceUtils
- ResourceYamlProcessor
- SpringConverterAdapter
- SpringDelegatingBeanProtocolURLConnectionFactory
- SpringEnvironmentURLConnectionFactory
- SpringFactoriesLoaderUtils
- SpringProfilesURLConnectionAdapter
- SpringPropertySourcesURLConnectionAdapter
- SpringProtocolURLStreamHandler
- SpringResourceURLConnection
- SpringResourceURLConnectionAdapter
- SpringResourceURLConnectionFactory
- SpringSubProtocolURLConnectionFactory
- SpringVersion
- SpringVersionUtils
- TTLCachePut
- TTLCacheResolver
- TTLCacheable
- TTLCachingConfiguration
- TTLContext
- UnderScoreJoinAliasGenerator
- YamlPropertySource
- YamlPropertySourceFactory
spring-guice
spring-jdbc
- CompoundJdbcEventListenerFactory
- EnableP6DataSource
- NoOpP6LoadableOptions
- P6DataSourceBeanDefinitionRegistrar
- P6DataSourceBeanPostProcessor
- PropertySourcesP6LoadableOptionsAdapter
- SpringP6SpyURLConnectionFactory
spring-test
- AbstractWebFluxTest
- AbstractWebMvcTest
- AnnotatedTypeMetadataTestFactory
- EmbeddedDataBaseBeanDefinitionRegistrar
- EmbeddedDataBaseBeanDefinitionsRegistrar
- EmbeddedDatabaseType
- EmbeddedTomcatConfiguration
- EmbeddedTomcatContextLoader
- EmbeddedTomcatMergedContextConfiguration
- EmbeddedTomcatTestContextBootstrapper
- EmbeddedZookeeperServer
- EmbeddedZookeeperServerTestExecutionListener
- EnableEmbeddedDatabase
- EnableEmbeddedDatabases
- MockServletWebRequest
- PersonHandler
- PersonHandler
- RouterFunctionTestConfig
- RouterFunctionTestConfig
- ServletTestUtils
- SimpleUrlHandlerMappingTestConfig
- SimpleUrlHandlerMappingTestConfig
- SpringLoggingTest
- SpringTestUtils
- SpringTestWebUtils
- TestConditionContext
- TestController
- TestFilter
- TestFilterRegistration
- TestServlet
- TestServletContext
- TestServletContextListener
- TestServletRegistration
- User
- WebTestUtils
spring-web
- AbstractNameValueExpression
- AbstractWebEndpointMappingFactory
- AbstractWebRequestRule
- CompositeWebEndpointMappingRegistry
- CompositeWebRequestRule
- ConsumeMediaTypeExpression
- DelegatingHandlerMethodAdvice
- EnableWebExtension
- FilterRegistrationWebEndpointMappingFactory
- FilteringWebEndpointMappingRegistry
- GenericMediaTypeExpression
- HandlerMetadata
- HandlerMethodAdvice
- HandlerMethodArgumentInterceptor
- HandlerMethodArgumentsResolvedEvent
- HandlerMethodInterceptor
- HandlerMethodMetadata
- HttpUtils
- Jackson2WebEndpointMappingFactory
- MediaTypeExpression
- MediaTypeUtils
- NameValueExpression
- ProduceMediaTypeExpression
- PropertyConstants
- RegistrationWebEndpointMappingFactory
- RequestAttributesUtils
- RequestContextStrategy
- ServletRegistrationWebEndpointMappingFactory
- ServletWebEndpointMappingResolver
- SimpleWebEndpointMappingRegistry
- SmartWebEndpointMappingFactory
- SpringWebHelper
- SpringWebType
- UnknownSpringWebHelper
- WebEndpointMapping
- WebEndpointMappingFactory
- WebEndpointMappingFilter
- WebEndpointMappingRegistrar
- WebEndpointMappingRegistry
- WebEndpointMappingResolver
- WebEndpointMappingsReadyEvent
- WebEventPublisher
- WebExtensionBeanDefinitionRegistrar
- WebRequestConsumesRule
- WebRequestHeaderExpression
- WebRequestHeadersRule
- WebRequestMethodsRule
- WebRequestParamExpression
- WebRequestParamsRule
- WebRequestPattensRule
- WebRequestProducesRule
- WebRequestRule
- WebRequestUtils
- WebScope
- WebSource
- WebTarget
- WebType
- WebUtils
spring-webflux
- CompositeWebFilter
- ConsumingWebEndpointMappingAdapter
- DelegatingWebFilter
- EnableWebFluxExtension
- HandlerMappingWebEndpointMappingFactory
- HandlerMappingWebEndpointMappingResolver
- HandlerMetadataWebEndpointMappingFactory
- InterceptingHandlerMethodProcessor
- MonoUtils
- RequestContextWebFilter
- RequestHandledEventPublishingWebFilter
- RequestMappingMetadataWebEndpointMappingFactory
- RequestPredicateKind
- RequestPredicateVisitorAdapter
- ReversedProxyHandlerMapping
- RouterFunctionVisitorAdapter
- ServerRequestHandledEvent
- ServerWebRequest
- SpringWebFluxHelper
- StoringRequestBodyArgumentInterceptor
- StoringResponseBodyReturnValueInterceptor
- WebFluxExtensionBeanDefinitionRegistrar
- WebServerScope
- WebServerUtils
spring-webmvc
- AbstractPageRenderContextHandlerInterceptor
- AnnotatedMethodHandlerInterceptor
- ConfigurableContentNegotiationManagerWebMvcConfigurer
- ConsumingWebEndpointMappingAdapter
- ContentCachingFilter
- EnableWebMvcExtension
- EnableWebMvcExtensionListener
- ExclusiveViewResolverApplicationListener
- HandlerMappingWebEndpointMappingFactory
- HandlerMappingWebEndpointMappingResolver
- HandlerMetadataWebEndpointMappingFactory
- HandlerMethodArgumentResolverAdvice
- InterceptingHandlerMethodProcessor
- LazyCompositeHandlerInterceptor
- LoggingHandlerMethodArgumentResolverAdvice
- LoggingMethodHandlerInterceptor
- LoggingPageRenderContextHandlerInterceptor
- MethodHandlerInterceptor
- PropertyConstants
- RequestBodyAdviceAdapter
- RequestMappingMetadata
- RequestMappingMetadataWebEndpointMappingFactory
- RequestPredicateVisitorAdapter
- ResponseBodyAdviceAdapter
- ReversedProxyHandlerMapping
- RouterFunctionVisitorAdapter
- SpringWebMvcHelper
- StoringRequestBodyArgumentAdvice
- StoringResponseBodyReturnValueAdvice
- ViewResolverUtils
- ViewUtils
- WebMvcExtensionBeanDefinitionRegistrar
- WebMvcExtensionConfiguration
- WebMvcUtils
- WebUtils