Top Description Inners Fields Constructors Methods
org.springframework.web.servlet.function

pack-priv Class DefaultServerRequest

extends Object
implements ServerRequest
Class Inheritance
All Implemented Interfaces
org.springframework.web.servlet.function.ServerRequest
Imports
java.io.IOException, .PrintWriter, java.lang.reflect.ParameterizedType, .Type, java.net.InetSocketAddress, .URI, java.nio.charset.Charset, java.security.Principal, java.time.Instant, java.util.AbstractMap, .AbstractSet, .ArrayList, .Arrays, .Collection, .Collections, .Enumeration, .Iterator, .List, .Locale, .Map, .Optional, .OptionalLong, .Set, java.util.function.Consumer, java.util.stream.Collectors, jakarta.servlet.ServletException, .ServletOutputStream, jakarta.servlet.http.Cookie, .HttpServletRequest, .HttpServletResponse, .HttpSession, .Part, org.springframework.core.ParameterizedTypeReference, .ResolvableType, org.springframework.http.HttpHeaders, .HttpMethod, .HttpRange, .MediaType, org.springframework.http.converter.GenericHttpMessageConverter, .HttpMessageConverter, org.springframework.http.server.RequestPath, .ServletServerHttpRequest, org.springframework.lang.NonNull, .Nullable, org.springframework.util.Assert, .CollectionUtils, .LinkedMultiValueMap, .MimeTypeUtils, .MultiValueMap, .ObjectUtils, org.springframework.validation.BindException, .BindingResult, org.springframework.web.HttpMediaTypeNotSupportedException, org.springframework.web.bind.ServletRequestDataBinder, .WebDataBinder, org.springframework.web.context.request.ServletWebRequest, .WebRequest, org.springframework.web.servlet.support.ServletUriComponentsBuilder, org.springframework.web.util.ServletRequestPathUtils, .UriBuilder

ServerRequest implementation based on a HttpServletRequest.
Authors
Arjen Poutsma, Sam Brannen, Patrick Strawderman
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>
private final ServerRequest.Headers
private final List<HttpMessageConverter<?>>
private final MultiValueMap<String, String>
private MultiValueMap<String, Part>
private final RequestPath
private final ServletServerHttpRequest

Constructor Summary

AccessConstructor and Description
public
DefaultServerRequest(HttpServletRequest servletRequest, List<HttpMessageConverter<?>> messageConverters)

Method Summary

Modifier and TypeMethod and Description
public Optional<Object>
attribute(String
the attribute name
name
)

Overrides default org.springframework.web.servlet.function.ServerRequest.attribute.

Get the request attribute value if present.

public Map<String, Object>
attributes()

Implements org.springframework.web.servlet.function.ServerRequest.attributes.

Get a mutable map of request attributes.

public <T> T
bind(Class<T>
the type of class to bind this request to
bindType
,
Consumer<WebDataBinder>
used to customize the data binder, e.g. set (dis)allowed fields
dataBinderCustomizer
)

Implements org.springframework.web.servlet.function.ServerRequest.bind.

Bind to this request and return an instance of the given type.

public <T> T
body(Class<T>
the type of return value
bodyType
)

Implements org.springframework.web.servlet.function.ServerRequest.body.

Extract the body as an object of the given type.

public <T> T
body(ParameterizedTypeReference<T>
the type of return value
bodyType
)

Implements org.springframework.web.servlet.function.ServerRequest.body.

Extract the body as an object of the given type.

pack-priv static Class<?>
private <T> T
bodyInternal(Type bodyType, Class<?> bodyClass)

pack-priv static Optional<ServerResponse>
checkNotModified(HttpServletRequest servletRequest, Instant lastModified, String etag)

public MultiValueMap<String, Cookie>
cookies()

Implements org.springframework.web.servlet.function.ServerRequest.cookies.

Get the cookies of this request.

private List<MediaType>
public ServerRequest.Headers
headers()

Implements org.springframework.web.servlet.function.ServerRequest.headers.

Get the headers of this request.

public List<HttpMessageConverter<?>>
messageConverters()

Implements org.springframework.web.servlet.function.ServerRequest.messageConverters.

Get the readers used to convert the body of this request.

public HttpMethod
public String
methodName()

Implements org.springframework.web.servlet.function.ServerRequest.methodName.

Deprecated

Get the name of the HTTP method.

public MultiValueMap<String, Part>
multipartData()

Implements org.springframework.web.servlet.function.ServerRequest.multipartData.

Get the parts of a multipart request, provided the Content-Type is "multipart/form-data", or an exception otherwise.

public Optional<String>
param(String
the parameter name
name
)

Overrides default org.springframework.web.servlet.function.ServerRequest.param.

Get the first parameter with the given name, if present.

public MultiValueMap<String, String>
params()

Implements org.springframework.web.servlet.function.ServerRequest.params.

Get all parameters for this request.

public Map<String, String>
pathVariables()

Implements org.springframework.web.servlet.function.ServerRequest.pathVariables.

Get all path variables for this request.

public Optional<Principal>
principal()

Implements org.springframework.web.servlet.function.ServerRequest.principal.

Get the authenticated user for the request, if any.

public Optional<InetSocketAddress>
remoteAddress()

Implements org.springframework.web.servlet.function.ServerRequest.remoteAddress.

Get the remote address to which this request is connected, if available.

public RequestPath
requestPath()

Overrides default org.springframework.web.servlet.function.ServerRequest.requestPath.

Get the request path as a PathContainer.

public HttpServletRequest
servletRequest()

Implements org.springframework.web.servlet.function.ServerRequest.servletRequest.

Get the servlet request that this request is based on.

public HttpSession
session()

Implements org.springframework.web.servlet.function.ServerRequest.session.

Get the web session for this request.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public URI
public UriBuilder
uriBuilder()

Implements org.springframework.web.servlet.function.ServerRequest.uriBuilder.

Get a UriBuilderComponents from the URI associated with this ServerRequest.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait