类 DefaultServerRequest.CheckNotModifiedResponse

java.lang.Object
cn.taketoday.core.AttributeAccessorSupport
cn.taketoday.web.RequestContext
cn.taketoday.web.handler.function.DefaultServerRequest.CheckNotModifiedResponse
所有已实现的接口:
cn.taketoday.core.AttributeAccessor, cn.taketoday.core.io.InputStreamSource, cn.taketoday.core.io.OutputStreamSource, HttpInputMessage, HttpMessage, HttpRequest, Serializable
封闭类:
DefaultServerRequest

static class DefaultServerRequest.CheckNotModifiedResponse extends RequestContext
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • status

      private int status
    • headers

      private final HttpHeaders headers
    • context

      private final RequestContext context
  • 构造器详细资料

    • CheckNotModifiedResponse

      protected CheckNotModifiedResponse(RequestContext context)
  • 方法详细资料

    • responseHeaders

      public HttpHeaders responseHeaders()
      从类复制的说明: RequestContext
      Get request HTTP headers
      覆盖:
      responseHeaders 在类中 RequestContext
    • getMethod

      public HttpMethod getMethod()
      从接口复制的说明: HttpRequest
      Return the HTTP method of the request.
      指定者:
      getMethod 在接口中 HttpRequest
      覆盖:
      getMethod 在类中 RequestContext
      返回:
      the HTTP method as an HttpMethod value
      另请参阅:
    • getMethodValue

      public String getMethodValue()
      从类复制的说明: RequestContext
      Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
      指定者:
      getMethodValue 在接口中 HttpRequest
      覆盖:
      getMethodValue 在类中 RequestContext
      返回:
      a String specifying the name of the method with which this request was made
      另请参阅:
    • getCookie

      @Nullable public HttpCookie getCookie(String name)
      从类复制的说明: RequestContext
      Returns a HttpCookie object the client sent with this request. This method returns null if no target cookie were sent.
      覆盖:
      getCookie 在类中 RequestContext
      参数:
      name - Cookie name
      返回:
      a HttpCookie object the client sent with this request. This method returns null if no target cookie were sent.
    • requestHeaders

      public HttpHeaders requestHeaders()
      从类复制的说明: RequestContext
      Get request HTTP headers
      覆盖:
      requestHeaders 在类中 RequestContext
      返回:
      request read only HTTP header ,never be null
    • nativeRequest

      public <T> T nativeRequest()
      从类复制的说明: RequestContext
      Native request eg: HttpServletRequest
      指定者:
      nativeRequest 在类中 RequestContext
    • unwrapRequest

      @Nullable public <T> T unwrapRequest(Class<T> requestClass)
      指定者:
      unwrapRequest 在类中 RequestContext
      参数:
      requestClass - wrapped request class
      返回:
      returns null indicated that not a requestClass
    • setStatus

      public void setStatus(int sc)
      从类复制的说明: RequestContext
      Sets 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()
      从类复制的说明: RequestContext
      Gets the current status code of this response.
      指定者:
      getStatus 在类中 RequestContext
      返回:
      the current status code of this response
    • sendError

      public void sendError(int sc) throws IOException
      从类复制的说明: RequestContext
      Sends 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 page

      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 code
      抛出:
      IOException - If an input or output exception occurs
    • sendError

      public void sendError(int sc, @Nullable String msg) throws IOException
      从类复制的说明: RequestContext

      Sends 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 code
      msg - the descriptive message
      抛出:
      IOException - If an input or output exception occurs
    • doGetOutputStream

      protected OutputStream doGetOutputStream() throws IOException
      从类复制的说明: RequestContext
      template method for get OutputStream
      指定者:
      doGetOutputStream 在类中 RequestContext
      抛出:
      IOException
    • getRequestTimeMillis

      public long getRequestTimeMillis()
      从类复制的说明: RequestContext
      Get start handling this request time millis
      指定者:
      getRequestTimeMillis 在类中 RequestContext
      返回:
      start handling this request time millis
    • getScheme

      public String getScheme()
      从类复制的说明: RequestContext
      Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.
      指定者:
      getScheme 在类中 RequestContext
      返回:
      a String containing the name of the scheme used to make this request
    • getServerName

      public String getServerName()
      从类复制的说明: RequestContext
      Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.
      指定者:
      getServerName 在类中 RequestContext
      返回:
      a String containing the name of the server
    • getServerPort

      public int getServerPort()
      从类复制的说明: RequestContext
      Returns the port number to which the request was sent. It is the value of the part after ":" in the Host header value, if any, or the server port where the client connection was accepted on.
      指定者:
      getServerPort 在类中 RequestContext
      返回:
      an integer specifying the port number
    • doGetRequestURI

      protected String doGetRequestURI()
      指定者:
      doGetRequestURI 在类中 RequestContext
    • getRequestURL

      public String getRequestURL()
      从类复制的说明: RequestContext
      The 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

      protected String doGetQueryString()
      指定者:
      doGetQueryString 在类中 RequestContext
    • doGetCookies

      protected HttpCookie[] doGetCookies()
      指定者:
      doGetCookies 在类中 RequestContext
      返回:
      an array of all the Cookies included with this request,or RequestContext.EMPTY_COOKIES if the request has no cookies
    • doGetMethod

      protected String doGetMethod()
      指定者:
      doGetMethod 在类中 RequestContext
    • getRemoteAddress

      public String getRemoteAddress()
      从类复制的说明: RequestContext
      Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
      指定者:
      getRemoteAddress 在类中 RequestContext
      返回:
      a String containing the IP address of the client that sent the request
    • getContentLength

      public long getContentLength()
      从类复制的说明: RequestContext
      Returns 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

      protected InputStream doGetInputStream() throws IOException
      指定者:
      doGetInputStream 在类中 RequestContext
      抛出:
      IOException
    • createMultipartRequest

      protected MultipartRequest createMultipartRequest()
      从类复制的说明: RequestContext
      create MultipartRequest
      指定者:
      createMultipartRequest 在类中 RequestContext
    • createAsyncWebRequest

      protected AsyncWebRequest createAsyncWebRequest()
      指定者:
      createAsyncWebRequest 在类中 RequestContext
    • getContentType

      public String getContentType()
      从类复制的说明: RequestContext
      Returns the MIME type of the body of the request, or null if the type is not known.
      指定者:
      getContentType 在类中 RequestContext
      返回:
      a String containing the name of the MIME type of the request, or null if the type is not known
    • createRequestHeaders

      protected HttpHeaders createRequestHeaders()
      从类复制的说明: RequestContext
      template method for create request http-headers
      指定者:
      createRequestHeaders 在类中 RequestContext
    • isCommitted

      public boolean isCommitted()
      从类复制的说明: RequestContext
      Returns 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

      public void sendRedirect(String location) throws IOException
      从类复制的说明: RequestContext
      Sends 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