类 DefaultServerRequest.CheckNotModifiedResponse
- 所有已实现的接口:
cn.taketoday.core.AttributeAccessor,cn.taketoday.core.io.InputStreamSource,cn.taketoday.core.io.OutputStreamSource,HttpInputMessage,HttpMessage,HttpRequest,Serializable
- 封闭类:
- DefaultServerRequest
-
字段概要
字段修饰符和类型字段说明private final RequestContextprivate final HttpHeadersprivate static final longprivate int从类继承的字段 cn.taketoday.web.RequestContext
applicationContext, asyncWebRequest, bindingContext, contextPath, cookies, corsRequestFlag, EMPTY_COOKIES, httpMethod, inputStream, locale, lookupPath, method, multipartFlag, multipartRequest, notModified, outputStream, parameters, pathWithinApplication, preFlightRequestFlag, queryString, reader, redirectModel, requestDestructionCallbacks, requestHeaders, requestPath, requestURI, responseContentType, responseCookies, responseHeaders, SCOPE_REQUEST, SCOPE_SESSION, uri, webAsyncManager, writer从类继承的字段 cn.taketoday.core.AttributeAccessorSupport
attributes -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected AsyncWebRequestprotected MultipartRequestcreate MultipartRequestprotected HttpHeaderstemplate method for create request http-headersprotected HttpCookie[]protected InputStreamprotected Stringprotected OutputStreamtemplate method for get OutputStreamprotected Stringprotected StringlongReturns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.Returns the MIME type of the body of the request, ornullif the type is not known.Returns aHttpCookieobject the client sent with this request.Return the HTTP method of the request.Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.longGet start handling this request time millisThe returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.Returns the name of the scheme used to make this request, for example,http,https, orftp.Returns the host name of the server to which the request was sent.intReturns the port number to which the request was sent.intGets the current status code of this response.booleanReturns a boolean indicating if the response has been committed.<T> TNative request eg: HttpServletRequestGet request HTTP headersGet request HTTP headersvoidsendError(int sc) Sends an error response to the client using the specified status code and clears the buffer.voidSends an error response to the client using the specified status and clears the buffer.voidsendRedirect(String location) Sends a temporary redirect response to the client using the specified redirect location URL and clears the buffer.voidsetStatus(int sc) Sets the status code for this response.<T> TunwrapRequest(Class<T> requestClass) 从类继承的方法 cn.taketoday.web.RequestContext
addCookie, addCookie, asHttpOutputMessage, binding, checkNotModified, checkNotModified, checkNotModified, createResponseHeaders, doGetContextPath, doGetLocale, doGetParameters, doGetReader, doGetRequestPath, doGetWriter, flush, getApplicationContext, getAsyncManager, getAsyncWebRequest, getBinding, getBody, getContextPath, getCookies, getHeaders, getInputRedirectModel, getInputRedirectModel, getInputStream, getLocale, getLookupPath, getMatchingMetadata, getMultipartRequest, getOutputStream, getParameter, getParameterNames, getParameters, getParameters, getPort, getQueryString, getReader, getRequestId, getRequestPath, getRequestProcessingTime, getRequestURI, getResponseContentType, getURI, getWriter, hasBinding, hasMatchingMetadata, initId, isConcurrentHandlingStarted, isCorsRequest, isMultipart, isNotModified, isPreFlightRequest, matchingMetadata, mergeToResponse, postGetParameters, postRequestCompleted, registerRequestDestructionCallback, registerRequestDestructionCallback, removeCookie, removeRequestDestructionCallback, requestCompleted, requestCompleted, reset, responseCookies, sendError, sendError, setBinding, setContentLength, setContentType, setContentType, setMatchingMetadata, setStatus, setWebAsyncManagerFactory, toString, writeHeaders从类继承的方法 cn.taketoday.core.AttributeAccessorSupport
attributeNames, clearAttributes, computeAttribute, copyAttributesFrom, createAttributes, equals, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttributes, hashCode, removeAttribute, setAttribute从接口继承的方法 cn.taketoday.core.AttributeAccessor
attributeNames, clearAttributes, computeAttribute, copyAttributesFrom, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttributes, removeAttribute, setAttribute从接口继承的方法 cn.taketoday.core.io.InputStreamSource
getReader, readableChannel从接口继承的方法 cn.taketoday.core.io.OutputStreamSource
writableChannel
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
status
private int status -
headers
-
context
-
-
构造器详细资料
-
CheckNotModifiedResponse
-
-
方法详细资料
-
responseHeaders
从类复制的说明:RequestContextGet request HTTP headers- 覆盖:
responseHeaders在类中RequestContext
-
getMethod
从接口复制的说明:HttpRequestReturn the HTTP method of the request.- 指定者:
getMethod在接口中HttpRequest- 覆盖:
getMethod在类中RequestContext- 返回:
- the HTTP method as an HttpMethod value
- 另请参阅:
-
getMethodValue
从类复制的说明:RequestContextReturns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.- 指定者:
getMethodValue在接口中HttpRequest- 覆盖:
getMethodValue在类中RequestContext- 返回:
- a
Stringspecifying the name of the method with which this request was made - 另请参阅:
-
getCookie
从类复制的说明:RequestContextReturns aHttpCookieobject the client sent with this request. This method returnsnullif no target cookie were sent.- 覆盖:
getCookie在类中RequestContext- 参数:
name- Cookie name- 返回:
- a
HttpCookieobject the client sent with this request. This method returnsnullif no target cookie were sent.
-
requestHeaders
从类复制的说明:RequestContextGet request HTTP headers- 覆盖:
requestHeaders在类中RequestContext- 返回:
- request read only HTTP header ,never be
null
-
nativeRequest
public <T> T nativeRequest()从类复制的说明:RequestContextNative request eg: HttpServletRequest- 指定者:
nativeRequest在类中RequestContext
-
unwrapRequest
- 指定者:
unwrapRequest在类中RequestContext- 参数:
requestClass- wrapped request class- 返回:
- returns
nullindicated that not a requestClass
-
setStatus
public void setStatus(int sc) 从类复制的说明:RequestContextSets the status code for this response.This method is used to set the return status code when there is no error .
This method preserves any cookies and other response headers.
Valid status codes are those in the 2XX, 3XX, 4XX, and 5XX ranges. Other status codes are treated as container specific.
- 指定者:
setStatus在类中RequestContext- 参数:
sc- the status code
-
getStatus
public int getStatus()从类复制的说明:RequestContextGets the current status code of this response.- 指定者:
getStatus在类中RequestContext- 返回:
- the current status code of this response
-
sendError
从类复制的说明:RequestContextSends an error response to the client using the specified status code and clears the buffer. The server will preserve cookies and may clear or update any headers needed to serve the error page as a valid response. If an error-page declaration has been made for the web application corresponding to the status code passed in, it will be served back the error pageIf the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
- 指定者:
sendError在类中RequestContext- 参数:
sc- the error status code- 抛出:
IOException- If an input or output exception occurs
-
sendError
从类复制的说明:RequestContextSends an error response to the client using the specified status and clears the buffer. The server defaults to creating the response to look like an HTML-formatted server error page containing the specified message, setting the content type to "text/html". The caller is not responsible for escaping or re-encoding the message to ensure it is safe with respect to the current response encoding and content type. This aspect of safety is the responsibility of the container, as it is generating the error page containing the message. The server will preserve cookies and may clear or update any headers needed to serve the error page as a valid response.
If an error-page declaration has been made for the web application corresponding to the status code passed in, it will be served back in preference to the suggested msg parameter and the msg parameter will be ignored.
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
- 指定者:
sendError在类中RequestContext- 参数:
sc- the error status codemsg- the descriptive message- 抛出:
IOException- If an input or output exception occurs
-
doGetOutputStream
从类复制的说明:RequestContexttemplate method for get OutputStream- 指定者:
doGetOutputStream在类中RequestContext- 抛出:
IOException
-
getRequestTimeMillis
public long getRequestTimeMillis()从类复制的说明:RequestContextGet start handling this request time millis- 指定者:
getRequestTimeMillis在类中RequestContext- 返回:
- start handling this request time millis
-
getScheme
从类复制的说明:RequestContextReturns the name of the scheme used to make this request, for example,http,https, orftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.- 指定者:
getScheme在类中RequestContext- 返回:
- a
Stringcontaining the name of the scheme used to make this request
-
getServerName
从类复制的说明:RequestContextReturns the host name of the server to which the request was sent. It is the value of the part before ":" in theHostheader value, if any, or the resolved server name, or the server IP address.- 指定者:
getServerName在类中RequestContext- 返回:
- a
Stringcontaining the name of the server
-
getServerPort
public int getServerPort()从类复制的说明:RequestContextReturns the port number to which the request was sent. It is the value of the part after ":" in theHostheader value, if any, or the server port where the client connection was accepted on.- 指定者:
getServerPort在类中RequestContext- 返回:
- an integer specifying the port number
-
doGetRequestURI
- 指定者:
doGetRequestURI在类中RequestContext
-
getRequestURL
从类复制的说明:RequestContextThe returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.- 覆盖:
getRequestURL在类中RequestContext- 返回:
- A URL
-
doGetQueryString
- 指定者:
doGetQueryString在类中RequestContext
-
doGetCookies
- 指定者:
doGetCookies在类中RequestContext- 返回:
- an array of all the Cookies included with this request,or
RequestContext.EMPTY_COOKIESif the request has no cookies
-
doGetMethod
- 指定者:
doGetMethod在类中RequestContext
-
getRemoteAddress
从类复制的说明:RequestContextReturns the Internet Protocol (IP) address of the client or last proxy that sent the request.- 指定者:
getRemoteAddress在类中RequestContext- 返回:
- a
Stringcontaining the IP address of the client that sent the request
-
getContentLength
public long getContentLength()从类复制的说明:RequestContextReturns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.- 指定者:
getContentLength在类中RequestContext- 返回:
- a long containing the length of the request body or -1L if the length is not known
-
doGetInputStream
- 指定者:
doGetInputStream在类中RequestContext- 抛出:
IOException
-
createMultipartRequest
从类复制的说明:RequestContextcreate MultipartRequest- 指定者:
createMultipartRequest在类中RequestContext
-
createAsyncWebRequest
- 指定者:
createAsyncWebRequest在类中RequestContext
-
getContentType
从类复制的说明:RequestContextReturns the MIME type of the body of the request, ornullif the type is not known.- 指定者:
getContentType在类中RequestContext- 返回:
- a
Stringcontaining the name of the MIME type of the request, or null if the type is not known
-
createRequestHeaders
从类复制的说明:RequestContexttemplate method for create request http-headers- 指定者:
createRequestHeaders在类中RequestContext
-
isCommitted
public boolean isCommitted()从类复制的说明:RequestContextReturns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.- 指定者:
isCommitted在类中RequestContext- 返回:
- a boolean indicating if the response has been committed
- 另请参阅:
-
sendRedirect
从类复制的说明:RequestContextSends a temporary redirect response to the client using the specified redirect location URL and clears the buffer. The buffer will be replaced with the data set by this method. Calling this method sets the status code to 302 (Found). This method can accept relative URLs;the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root. If the location is relative with two leading '/' the container interprets it as a network-path reference (see RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, section 4.2 "Relative Reference").If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
- 指定者:
sendRedirect在类中RequestContext- 参数:
location- the redirect location URL- 抛出:
IOException- If an input or output exception occurs
-