类 ServletServerHttpRequest
java.lang.Object
cn.taketoday.http.server.ServletServerHttpRequest
- 所有已实现的接口:
HttpInputMessage,HttpMessage,HttpRequest,ServerHttpRequest
ServerHttpRequest implementation that is based on a HttpServletRequest.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev, Juergen Hoeller, Harry Yang
-
字段概要
字段修饰符和类型字段说明private ServerHttpAsyncRequestControlprotected static final Charsetprivate HttpHeadersprivate final HttpMethodprivate final HttpServletRequestprivate URI -
构造器概要
构造器构造器说明ServletServerHttpRequest(HttpServletRequest servletRequest) Construct a new instance of the ServletServerHttpRequest based on the givenHttpServletRequest. -
方法概要
修饰符和类型方法说明getAsyncRequestControl(ServerHttpResponse response) Return a control that allows putting the request in asynchronous mode so the response remains open until closed explicitly from the current or another thread.getBody()Return the body of the message as an input stream.private static InputStreamUseServletRequest.getParameterMap()to reconstruct the body of a form 'POST' providing a predictable outcome as opposed to reading from the body, which can fail if any other code has used the ServletRequest to access a parameter, thus causing the input stream to be "consumed".Return the headers of this message.Return the address on which the request was received.Return the HTTP method of the request.Return aPrincipalinstance containing the name of the authenticated user.Return the address of the remote client.Returns theHttpServletRequestthis object is based on.getURI()Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).static URIinitURI(HttpServletRequest servletRequest) Initialize a URI from the given Servlet request.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpRequest
getMethodValue
-
字段详细资料
-
FORM_CHARSET
-
servletRequest
-
uri
-
headers
-
asyncRequestControl
-
method
-
-
构造器详细资料
-
ServletServerHttpRequest
Construct a new instance of the ServletServerHttpRequest based on the givenHttpServletRequest.- 参数:
servletRequest- the servlet request
-
-
方法详细资料
-
getServletRequest
Returns theHttpServletRequestthis object is based on. -
getMethod
从接口复制的说明:HttpRequestReturn the HTTP method of the request.- 指定者:
getMethod在接口中HttpRequest- 返回:
- the HTTP method as an HttpMethod value
- 另请参阅:
-
getURI
从接口复制的说明:HttpRequestReturn the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).- 指定者:
getURI在接口中HttpRequest- 返回:
- the URI of the request (never
null)
-
initURI
Initialize a URI from the given Servlet request.- 参数:
servletRequest- the request- 返回:
- the initialized URI
-
getHeaders
从接口复制的说明:HttpMessageReturn the headers of this message.- 指定者:
getHeaders在接口中HttpMessage- 返回:
- a corresponding HttpHeaders object (never
null)
-
getPrincipal
从接口复制的说明:ServerHttpRequestReturn aPrincipalinstance containing the name of the authenticated user.If the user has not been authenticated, the method returns
null.- 指定者:
getPrincipal在接口中ServerHttpRequest
-
getLocalAddress
从接口复制的说明:ServerHttpRequestReturn the address on which the request was received.- 指定者:
getLocalAddress在接口中ServerHttpRequest
-
getRemoteAddress
从接口复制的说明:ServerHttpRequestReturn the address of the remote client.- 指定者:
getRemoteAddress在接口中ServerHttpRequest
-
getBody
从接口复制的说明:HttpInputMessageReturn the body of the message as an input stream.- 指定者:
getBody在接口中HttpInputMessage- 返回:
- the input stream body (never
null) - 抛出:
IOException- in case of I/O errors
-
getAsyncRequestControl
从接口复制的说明:ServerHttpRequestReturn a control that allows putting the request in asynchronous mode so the response remains open until closed explicitly from the current or another thread.- 指定者:
getAsyncRequestControl在接口中ServerHttpRequest
-
getBodyFromServletRequestParameters
private static InputStream getBodyFromServletRequestParameters(HttpServletRequest request) throws IOException UseServletRequest.getParameterMap()to reconstruct the body of a form 'POST' providing a predictable outcome as opposed to reading from the body, which can fail if any other code has used the ServletRequest to access a parameter, thus causing the input stream to be "consumed".- 抛出:
IOException
-