类 RequestPredicates.SubPathServerRequestWrapper
- 所有已实现的接口:
ServerRequest,ServerResponse.Context
- 封闭类:
- RequestPredicates
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.web.handler.function.ServerRequest
ServerRequest.Builder, ServerRequest.Headers -
字段概要
字段 -
构造器概要
构造器构造器说明SubPathServerRequestWrapper(ServerRequest request, PathPattern.PathRemainingMatchInfo info, PathPattern pattern) -
方法概要
修饰符和类型方法说明Get the request attribute value if present.Get a mutable map of request attributes.<T> TBind to this request and return an instance of the given type.<T> Tbind(Class<T> bindType, Consumer<WebDataBinder> dataBinderCustomizer) Bind to this request and return an instance of the given type.<T> Tbody(cn.taketoday.core.ParameterizedTypeReference<T> bodyType) Extract the body as an object of the given type.<T> TExtract the body as an object of the given type.checkNotModified(String etag) Check whether the requested resource has been modified given the suppliedETag(entity tag), as determined by the application.checkNotModified(Instant lastModified) Check whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application).checkNotModified(Instant lastModified, String etag) Check whether the requested resource has been modified given the suppliedETag(entity tag) and last-modified timestamp, as determined by the application.cn.taketoday.util.MultiValueMap<String,HttpCookie> cookies()Get the cookies of this request.exchange()Get the request that this request is based on.headers()Get the headers of this request.mergeAttributes(ServerRequest request, Map<String, String> pathVariables, PathPattern pattern) Get the readers used to convert the body of this request.method()Get the HTTP method.Get the name of the HTTP method.Get the parts of a multipart request, provided the Content-Type is"multipart/form-data", or an exception otherwise.Get the first parameter with the given name, if present.params()Get all parameters for this request. parameters are contained in the query string or posted form data.Get the parameters with the given name.Get all path variables for this request.Get the remote address to which this request is connected, if available.Get the request path as aPathContainer.private static RequestPathrequestPath(RequestPath original, PathPattern.PathRemainingMatchInfo info) toString()uri()Get the request URI.Get aUriBuilderComponentsfrom the URI associated with thisServerRequest.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.web.handler.function.ServerRequest
path, pathVariable
-
字段详细资料
-
request
-
requestPath
-
attributes
-
-
构造器详细资料
-
SubPathServerRequestWrapper
public SubPathServerRequestWrapper(ServerRequest request, PathPattern.PathRemainingMatchInfo info, PathPattern pattern)
-
-
方法详细资料
-
requestPath
private static RequestPath requestPath(RequestPath original, PathPattern.PathRemainingMatchInfo info) -
mergeAttributes
private static Map<String,Object> mergeAttributes(ServerRequest request, Map<String, String> pathVariables, PathPattern pattern) -
method
从接口复制的说明:ServerRequestGet the HTTP method.- 指定者:
method在接口中ServerRequest- 返回:
- the HTTP method as an HttpMethod enum value, or
nullif not resolvable (e.g. in case of a non-standard HTTP method)
-
methodName
从接口复制的说明:ServerRequestGet the name of the HTTP method.- 指定者:
methodName在接口中ServerRequest- 返回:
- the HTTP method as a String
-
uri
从接口复制的说明:ServerRequestGet the request URI.- 指定者:
uri在接口中ServerRequest
-
uriBuilder
从接口复制的说明:ServerRequestGet aUriBuilderComponentsfrom the URI associated with thisServerRequest.- 指定者:
uriBuilder在接口中ServerRequest- 返回:
- a URI builder
-
requestPath
从接口复制的说明:ServerRequestGet the request path as aPathContainer.- 指定者:
requestPath在接口中ServerRequest
-
headers
从接口复制的说明:ServerRequestGet the headers of this request.- 指定者:
headers在接口中ServerRequest
-
cookies
从接口复制的说明:ServerRequestGet the cookies of this request.- 指定者:
cookies在接口中ServerRequest
-
remoteAddress
从接口复制的说明:ServerRequestGet the remote address to which this request is connected, if available.- 指定者:
remoteAddress在接口中ServerRequest
-
messageConverters
从接口复制的说明:ServerRequestGet the readers used to convert the body of this request.- 指定者:
messageConverters在接口中ServerRequest- 指定者:
messageConverters在接口中ServerResponse.Context- 返回:
- the list of message writers
-
body
从接口复制的说明:ServerRequestExtract the body as an object of the given type.- 指定者:
body在接口中ServerRequest- 类型参数:
T- the body type- 参数:
bodyType- the type of return value- 返回:
- the body
- 抛出:
IOException
-
body
从接口复制的说明:ServerRequestExtract the body as an object of the given type.- 指定者:
body在接口中ServerRequest- 类型参数:
T- the body type- 参数:
bodyType- the type of return value- 返回:
- the body
- 抛出:
IOException
-
bind
从接口复制的说明:ServerRequestBind to this request and return an instance of the given type.- 指定者:
bind在接口中ServerRequest- 类型参数:
T- the type to bind to- 参数:
bindType- the type of class to bind this request to- 返回:
- a constructed and bound instance of
bindType - 抛出:
cn.taketoday.validation.BindException- in case of binding errors
-
bind
public <T> T bind(Class<T> bindType, Consumer<WebDataBinder> dataBinderCustomizer) throws cn.taketoday.validation.BindException 从接口复制的说明:ServerRequestBind to this request and return an instance of the given type.- 指定者:
bind在接口中ServerRequest- 类型参数:
T- the type to bind to- 参数:
bindType- the type of class to bind this request todataBinderCustomizer- used to customize the data binder, e.g. set (dis)allowed fields- 返回:
- a constructed and bound instance of
bindType - 抛出:
cn.taketoday.validation.BindException- in case of binding errors
-
attribute
从接口复制的说明:ServerRequestGet the request attribute value if present.- 指定者:
attribute在接口中ServerRequest- 参数:
name- the attribute name- 返回:
- the attribute value
-
attributes
从接口复制的说明:ServerRequestGet a mutable map of request attributes.- 指定者:
attributes在接口中ServerRequest- 返回:
- the request attributes
-
param
从接口复制的说明:ServerRequestGet the first parameter with the given name, if present. parameters are contained in the query string or posted form data.- 指定者:
param在接口中ServerRequest- 参数:
name- the parameter name- 返回:
- the parameter value
- 另请参阅:
-
params
从接口复制的说明:ServerRequestGet the parameters with the given name.parameters are contained in the query string or posted form data.
- 指定者:
params在接口中ServerRequest- 参数:
name- the parameter name- 返回:
- the parameter value
- 另请参阅:
-
params
从接口复制的说明:ServerRequestGet all parameters for this request. parameters are contained in the query string or posted form data.- 指定者:
params在接口中ServerRequest- 另请参阅:
-
multipartData
从接口复制的说明:ServerRequestGet the parts of a multipart request, provided the Content-Type is"multipart/form-data", or an exception otherwise.- 指定者:
multipartData在接口中ServerRequest- 返回:
- the multipart data, mapping from name to part(s)
- 抛出:
IOException- if an I/O error occurred during the retrieval- 另请参阅:
-
pathVariables
从接口复制的说明:ServerRequestGet all path variables for this request.- 指定者:
pathVariables在接口中ServerRequest
-
exchange
从接口复制的说明:ServerRequestGet the request that this request is based on.- 指定者:
exchange在接口中ServerRequest
-
checkNotModified
从接口复制的说明:ServerRequestCheck whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application). If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.Typical usage:
public ServerResponse myHandleMethod(ServerRequest request) { Instant lastModified = // application-specific calculation return request.checkNotModified(lastModified) .orElseGet(() -> { // further request processing, actually building content return ServerResponse.ok().body(...); }); }This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.
Note: you can use either this
#checkNotModified(Instant)method; orServerRequest.checkNotModified(String). If you want to enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should useServerRequest.checkNotModified(Instant, String).- 指定者:
checkNotModified在接口中ServerRequest- 参数:
lastModified- the last-modified timestamp that the application determined for the underlying resource- 返回:
- a corresponding response if the request qualifies as not modified, or an empty result otherwise.
-
checkNotModified
从接口复制的说明:ServerRequestCheck whether the requested resource has been modified given the suppliedETag(entity tag), as determined by the application. If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.Typical usage:
public ServerResponse myHandleMethod(ServerRequest request) { String eTag = // application-specific calculation return request.checkNotModified(eTag) .orElseGet(() -> { // further request processing, actually building content return ServerResponse.ok().body(...); }); }This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.
Note: you can use either this
ServerRequest.checkNotModified(Instant)method; or#checkNotModified(String). If you want to enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should useServerRequest.checkNotModified(Instant, String).- 指定者:
checkNotModified在接口中ServerRequest- 参数:
etag- the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.- 返回:
- a corresponding response if the request qualifies as not modified, or an empty result otherwise.
-
checkNotModified
从接口复制的说明:ServerRequestCheck whether the requested resource has been modified given the suppliedETag(entity tag) and last-modified timestamp, as determined by the application. If not modified, this method returns a response with corresponding status code and headers, otherwise an empty result.Typical usage:
public ServerResponse myHandleMethod(ServerRequest request) { Instant lastModified = // application-specific calculation String eTag = // application-specific calculation return request.checkNotModified(lastModified, eTag) .orElseGet(() -> { // further request processing, actually building content return ServerResponse.ok().body(...); }); }This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.
- 指定者:
checkNotModified在接口中ServerRequest- 参数:
lastModified- the last-modified timestamp that the application determined for the underlying resourceetag- the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.- 返回:
- a corresponding response if the request qualifies as not modified, or an empty result otherwise.
-
toString
-