程序包 cn.taketoday.web

类 DecoratingRequestContext

java.lang.Object
cn.taketoday.core.AttributeAccessorSupport
cn.taketoday.web.RequestContext
cn.taketoday.web.DecoratingRequestContext
所有已实现的接口:
cn.taketoday.core.AttributeAccessor, cn.taketoday.core.io.InputStreamSource, cn.taketoday.core.io.OutputStreamSource, HttpInputMessage, HttpMessage, HttpRequest, Serializable
直接已知子类:
RequestContextDecorator, RequestContextUtils.InjectableRequestContext

public abstract class DecoratingRequestContext extends RequestContext
Decorating RequestContext

Provides a convenient implementation of the RequestContext that can be subclassed by developers wishing to adapt the request to web. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.

从以下版本开始:
4.0 2023/6/13 23:38
作者:
Harry Yang
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
  • 构造器详细资料

    • DecoratingRequestContext

      protected DecoratingRequestContext()
  • 方法详细资料

    • getRequestTimeMillis

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

      public String getRequestId()
      从类复制的说明: RequestContext
      Obtain a unique identifier string for this request.

      There is no defined format for this string. The format is implementation dependent.

      覆盖:
      getRequestId 在类中 RequestContext
      返回:
      A unique identifier for the request
    • initId

      @Nullable protected String initId()
      从类复制的说明: RequestContext
      Obtain the request id to use, or null in which case the Object identity of this request instance is used.
      覆盖:
      initId 在类中 RequestContext
    • getApplicationContext

      public cn.taketoday.context.ApplicationContext getApplicationContext()
      从类复制的说明: RequestContext
      Return the WebApplicationContext that this request runs in.
      覆盖:
      getApplicationContext 在类中 RequestContext
    • getReader

      public Reader getReader(String encoding) throws IOException
      抛出:
      IOException
    • readableChannel

      public ReadableByteChannel readableChannel() throws IOException
      抛出:
      IOException
    • writableChannel

      public WritableByteChannel writableChannel() throws IOException
      抛出:
      IOException
    • 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
    • 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
    • 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
    • getContextPath

      public String getContextPath()
      从类复制的说明: RequestContext
      Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "" character but does not end with a "" character. The container does not decode this string.
      覆盖:
      getContextPath 在类中 RequestContext
      返回:
      a String specifying the portion of the request URI that indicates the context of the request
    • doGetContextPath

      protected String doGetContextPath()
      覆盖:
      doGetContextPath 在类中 RequestContext
    • getURI

      public URI getURI()
      从接口复制的说明: HttpRequest
      Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).
      指定者:
      getURI 在接口中 HttpRequest
      覆盖:
      getURI 在类中 RequestContext
      返回:
      the URI of the request (never null)
    • getRequestURI

      public String getRequestURI()
      从类复制的说明: RequestContext
      Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String. For example:
      First line of HTTP request Returned Value
      POST /some/path.html HTTP/1.1 /some/path.html
      GET http://foo.bar/a.html HTTP/1.0 /a.html
      HEAD /xyz?a=b HTTP/1.1 /xyz
      覆盖:
      getRequestURI 在类中 RequestContext
      返回:
      a String containing the part of the URL from the protocol name up to the query string
    • getLookupPath

      public PathContainer getLookupPath()
      覆盖:
      getLookupPath 在类中 RequestContext
    • isPreFlightRequest

      public boolean isPreFlightRequest()
      从类复制的说明: RequestContext
      Returns true if the request is a valid CORS pre-flight one by checking {code OPTIONS} method with Origin and Access-Control-Request-Method headers presence.
      覆盖:
      isPreFlightRequest 在类中 RequestContext
    • isCorsRequest

      public boolean isCorsRequest()
      从类复制的说明: RequestContext
      Returns true if the request is a valid CORS one by checking Originheader presence and ensuring that origins are different.
      覆盖:
      isCorsRequest 在类中 RequestContext
    • getRequestPath

      public RequestPath getRequestPath()
      覆盖:
      getRequestPath 在类中 RequestContext
      另请参阅:
    • 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
    • getQueryString

      public String getQueryString()
      从类复制的说明: RequestContext
      Returns the query string that is contained in the request URL after the path. This method returns null if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.
      覆盖:
      getQueryString 在类中 RequestContext
      返回:
      a String containing the query string or null if the URL contains no query string. The value is not decoded by the container.
    • doGetQueryString

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

      public HttpCookie[] getCookies()
      从类复制的说明: RequestContext
      Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.
      覆盖:
      getCookies 在类中 RequestContext
      返回:
      an array of all the Cookies included with this request, or RequestContext.EMPTY_COOKIES if the request has no cookies
    • 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
    • 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.
    • addCookie

      public void addCookie(HttpCookie cookie)
      从类复制的说明: RequestContext
      Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.
      覆盖:
      addCookie 在类中 RequestContext
      参数:
      cookie - the Cookie to return to the client
    • addCookie

      public void addCookie(String name, @Nullable String value)
      从类复制的说明: RequestContext
      Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.
      覆盖:
      addCookie 在类中 RequestContext
      参数:
      name - the Cookie name to return to the client
      value - the Cookie value to return to the client
    • removeCookie

      public List<HttpCookie> removeCookie(String name)
      从类复制的说明: RequestContext
      remove the specified cookie from response
      覆盖:
      removeCookie 在类中 RequestContext
      参数:
      name - cookie name
      返回:
      removed cookie
    • responseCookies

      public ArrayList<HttpCookie> responseCookies()
      覆盖:
      responseCookies 在类中 RequestContext
    • getParameters

      public Map<String,String[]> getParameters()
      从类复制的说明: RequestContext
      Returns a java.util.Map of the parameters of this request.

      Request parameters are extra information sent with the request. Parameters are contained in the query string or posted form data.

      覆盖:
      getParameters 在类中 RequestContext
      返回:
      java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
    • doGetParameters

      protected Map<String,String[]> doGetParameters()
      覆盖:
      doGetParameters 在类中 RequestContext
    • postGetParameters

      protected void postGetParameters(cn.taketoday.util.MultiValueMap<String,String> parameters)
      覆盖:
      postGetParameters 在类中 RequestContext
    • getParameterNames

      public Iterator<String> getParameterNames()
      从类复制的说明: RequestContext
      Returns an Iterator of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Iterator.
      覆盖:
      getParameterNames 在类中 RequestContext
      返回:
      an Iterator of String objects, each String containing the name of a request parameter; or an empty Iterator if the request has no parameters
    • getParameters

      @Nullable public String[] getParameters(String name)
      从类复制的说明: RequestContext
      Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

      If the parameter has a single value, the array has a length of 1.

      覆盖:
      getParameters 在类中 RequestContext
      参数:
      name - a String containing the name of the parameter whose value is requested
      返回:
      an array of String objects containing the parameter's values
      另请参阅:
    • getParameter

      @Nullable public String getParameter(String name)
      从类复制的说明: RequestContext
      Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. Parameters are contained in the query string or posted form data.

      You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use RequestContext.getParameters(String).

      If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by parameters(String).

      If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via RequestContext.getInputStream() or RequestContext.getReader() can interfere with the execution of this method.

      覆盖:
      getParameter 在类中 RequestContext
      参数:
      name - a String specifying the name of the parameter
      返回:
      a String representing the single value of the parameter
      另请参阅:
    • 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
    • getBody

      public InputStream getBody() throws IOException
      从接口复制的说明: HttpInputMessage
      Return the body of the message as an input stream.
      指定者:
      getBody 在接口中 HttpInputMessage
      覆盖:
      getBody 在类中 RequestContext
      返回:
      the input stream body (never null)
      抛出:
      IOException - in case of I/O errors
    • getHeaders

      public HttpHeaders getHeaders()
      从接口复制的说明: HttpMessage
      Return the headers of this message.
      指定者:
      getHeaders 在接口中 HttpMessage
      覆盖:
      getHeaders 在类中 RequestContext
      返回:
      a corresponding HttpHeaders object (never null)
    • getInputStream

      public InputStream getInputStream() throws IOException
      从类复制的说明: RequestContext
      Retrieves the body of the request as binary data using a InputStream. Either this method or RequestContext.getReader() may be called to read the body, not both.
      指定者:
      getInputStream 在接口中 cn.taketoday.core.io.InputStreamSource
      覆盖:
      getInputStream 在类中 RequestContext
      返回:
      a InputStream object containing the body of the request
      抛出:
      IOException - if an input or output exception occurred
    • doGetInputStream

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

      public BufferedReader getReader() throws IOException
      从类复制的说明: RequestContext
      Retrieves the body of the request as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or RequestContext.getInputStream() may be called to read the body, not both.
      指定者:
      getReader 在接口中 cn.taketoday.core.io.InputStreamSource
      覆盖:
      getReader 在类中 RequestContext
      返回:
      a BufferedReader containing the body of the request
      抛出:
      IOException - if an input or output exception occurred
      另请参阅:
    • doGetReader

      protected BufferedReader doGetReader() throws IOException
      从类复制的说明: RequestContext
      template method for get reader
      覆盖:
      doGetReader 在类中 RequestContext
      抛出:
      IOException
    • isMultipart

      public boolean isMultipart()
      覆盖:
      isMultipart 在类中 RequestContext
      返回:
      return whether this request is multipart
    • 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
    • requestHeaders

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

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

      public Locale getLocale()
      从类复制的说明: RequestContext
      Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.
      覆盖:
      getLocale 在类中 RequestContext
      返回:
      the preferred Locale for the client
    • doGetLocale

      protected Locale doGetLocale()
      覆盖:
      doGetLocale 在类中 RequestContext
    • checkNotModified

      public boolean checkNotModified(long lastModifiedTimestamp)
      从类复制的说明: RequestContext
      Check whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application).

      This will also transparently set the "Last-Modified" response header and HTTP status when applicable.

      Typical usage:

      
       public String myHandleMethod(RequestContext request, Model model) {
         long lastModified = // application-specific calculation
         if (request.checkNotModified(lastModified)) {
           // shortcut exit - no further processing necessary
           return null;
         }
         // further request processing, actually building content
         model.addAttribute(...);
         return "myViewName";
       }
       

      This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.

      Note: you can use either this #checkNotModified(long) method; or RequestContext.checkNotModified(String). If you want enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should use RequestContext.checkNotModified(String, long).

      If the "If-Modified-Since" header is set but cannot be parsed to a date value, this method will ignore the header and proceed with setting the last-modified timestamp on the response.

      覆盖:
      checkNotModified 在类中 RequestContext
      参数:
      lastModifiedTimestamp - the last-modified timestamp in milliseconds that the application determined for the underlying resource
      返回:
      whether the request qualifies as not modified, allowing to abort request processing and relying on the response telling the client that the content has not been modified
    • checkNotModified

      public boolean checkNotModified(String etag)
      从类复制的说明: RequestContext
      Check whether the requested resource has been modified given the supplied ETag (entity tag), as determined by the application.

      This will also transparently set the "ETag" response header and HTTP status when applicable.

      Typical usage:

      
       public String myHandleMethod(RequestContext request, Model model) {
         String eTag = // application-specific calculation
         if (request.checkNotModified(eTag)) {
           // shortcut exit - no further processing necessary
           return null;
         }
         // further request processing, actually building content
         model.addAttribute(...);
         return "myViewName";
       }
       

      Note: you can use either this #checkNotModified(String) method; or RequestContext.checkNotModified(long). If you want enforce both a strong entity tag and a Last-Modified value, as recommended by the HTTP specification, then you should use RequestContext.checkNotModified(String, long).

      覆盖:
      checkNotModified 在类中 RequestContext
      参数:
      etag - the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.
      返回:
      true if the request does not require further processing.
    • checkNotModified

      public boolean checkNotModified(@Nullable String etag, long lastModifiedTimestamp)
      从类复制的说明: RequestContext
      Check whether the requested resource has been modified given the supplied ETag (entity tag) and last-modified timestamp, as determined by the application.

      This will also transparently set the "ETag" and "Last-Modified" response headers, and HTTP status when applicable.

      Typical usage:

      
       public String myHandleMethod(RequestContext request, Model model) {
         String eTag = // application-specific calculation
         long lastModified = // application-specific calculation
         if (request.checkNotModified(eTag, lastModified)) {
           // shortcut exit - no further processing necessary
           return null;
         }
         // further request processing, actually building content
         model.addAttribute(...);
         return "myViewName";
       }
       

      This method works with conditional GET/HEAD requests, but also with conditional POST/PUT/DELETE requests.

      Note: The HTTP specification recommends setting both ETag and Last-Modified values, but you can also use #checkNotModified(String) or RequestContext.checkNotModified(long).

      覆盖:
      checkNotModified 在类中 RequestContext
      参数:
      etag - the entity tag that the application determined for the underlying resource. This parameter will be padded with quotes (") if necessary.
      lastModifiedTimestamp - the last-modified timestamp in milliseconds that the application determined for the underlying resource
      返回:
      true if the request does not require further processing.
    • isNotModified

      public boolean isNotModified()
      覆盖:
      isNotModified 在类中 RequestContext
    • setContentLength

      public void setContentLength(long length)
      从类复制的说明: RequestContext
      Sets the length of the content body in the response , this method sets the HTTP Content-Length header.
      覆盖:
      setContentLength 在类中 RequestContext
      参数:
      length - an long specifying the length of the content being returned to the client; sets the Content-Length header
    • 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
      另请参阅:
    • reset

      public void reset()
      从类复制的说明: RequestContext
      Clears any data that exists in the buffer as well as the status code, headers. The state of calling RequestContext.getWriter() or RequestContext.getOutputStream() is also cleared. It is legal, for instance, to call RequestContext.getWriter(), reset() and then RequestContext.getOutputStream(). If RequestContext.getWriter() or RequestContext.getOutputStream() have been called before this method, then the corresponding returned Writer or OutputStream will be staled and the behavior of using the stale object is undefined. If the response has been committed, this method throws an IllegalStateException.
      覆盖:
      reset 在类中 RequestContext
    • 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
    • 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
    • setStatus

      public void setStatus(HttpStatusCode status)
      从类复制的说明: RequestContext
      Sets the status code and message for this response.
      覆盖:
      setStatus 在类中 RequestContext
      参数:
      status - the status
    • 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(HttpStatusCode code) 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
      参数:
      code - the error status code
      抛出:
      IOException - If an input or output exception occurs
    • sendError

      public void sendError(HttpStatusCode code, @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
      参数:
      code - the error status code
      msg - the descriptive message
      抛出:
      IOException - If an input or output exception occurs
    • 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
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      从类复制的说明: RequestContext
      Returns a OutputStream suitable for writing binary data in the response. The Server container does not encode the binary data.

      Calling flush() on the OutputStream commits the response. Either this method or RequestContext.getWriter() may be called to write the body, not both, except when RequestContext.reset() has been called.

      指定者:
      getOutputStream 在接口中 cn.taketoday.core.io.OutputStreamSource
      覆盖:
      getOutputStream 在类中 RequestContext
      返回:
      a OutputStream for writing binary data
      抛出:
      IOException - if an input or output exception occurred
      另请参阅:
    • doGetOutputStream

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

      public PrintWriter getWriter() throws IOException
      从类复制的说明: RequestContext
      Returns a PrintWriter object that can send character text to the client. The PrintWriter uses the UTF-8 character encoding.

      Calling flush() on the PrintWriter commits the response.

      Either this method or RequestContext.getOutputStream() may be called to write the body, not both, except when RequestContext.reset() has been called.

      指定者:
      getWriter 在接口中 cn.taketoday.core.io.OutputStreamSource
      覆盖:
      getWriter 在类中 RequestContext
      返回:
      a PrintWriter object that can return character data to the client
      抛出:
      IOException - if an input or output exception occurred
      另请参阅:
    • doGetWriter

      protected PrintWriter doGetWriter() throws IOException
      从类复制的说明: RequestContext
      template method for get writer
      覆盖:
      doGetWriter 在类中 RequestContext
      抛出:
      IOException
    • setContentType

      public void setContentType(String contentType)
      从类复制的说明: RequestContext
      Sets the content type of the response being sent to the client, if the response has not been committed yet. The given content type may include a character encoding specification, for example, text/html;charset=UTF-8. The response's character encoding is only set from the given content type if this method is called before getWriter is called.

      This method may be called repeatedly to change content type and character encoding. This method has no effect if called after the response has been committed. It does not set the response's character encoding if it is called after getWriter has been called or after the response has been committed.

      Containers must communicate the content type and the character encoding used for the servlet response's writer to the client if the protocol provides a way for doing so. In the case of HTTP, the Content-Type header is used.

      覆盖:
      setContentType 在类中 RequestContext
      参数:
      contentType - a String specifying the MIME type of the content
    • setContentType

      public void setContentType(MediaType contentType)
      从类复制的说明: RequestContext
      Sets the content type of the response being sent to the client, if the response has not been committed yet. The given content type may include a character encoding specification, for example, text/html;charset=UTF-8. The response's character encoding is only set from the given content type if this method is called before getWriter is called.

      This method may be called repeatedly to change content type and character encoding. This method has no effect if called after the response has been committed. It does not set the response's character encoding if it is called after getWriter has been called or after the response has been committed.

      Containers must communicate the content type and the character encoding used for the servlet response's writer to the client if the protocol provides a way for doing so. In the case of HTTP, the Content-Type header is used.

      覆盖:
      setContentType 在类中 RequestContext
      参数:
      contentType - a String specifying the MIME type of the content
    • getResponseContentType

      @Nullable public String getResponseContentType()
      从类复制的说明: RequestContext
      Returns the content type used for the MIME body sent in this response. The content type proper must have been specified using RequestContext.setContentType(java.lang.String) before the response is committed. If no content type has been specified, this method returns null.
      覆盖:
      getResponseContentType 在类中 RequestContext
      返回:
      a String specifying the content type, for example, text/html; charset=UTF-8, or null
      另请参阅:
    • responseHeaders

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

      public void mergeToResponse(HttpHeaders headers)
      从类复制的说明: RequestContext
      merge headers to response http-headers
      覆盖:
      mergeToResponse 在类中 RequestContext
    • createResponseHeaders

      public HttpHeaders createResponseHeaders()
      从类复制的说明: RequestContext
      create a new response http-header
      覆盖:
      createResponseHeaders 在类中 RequestContext
    • asHttpOutputMessage

      public ServerHttpResponse asHttpOutputMessage()
      覆盖:
      asHttpOutputMessage 在类中 RequestContext
    • 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
    • getMatchingMetadata

      public HandlerMatchingMetadata getMatchingMetadata()
      覆盖:
      getMatchingMetadata 在类中 RequestContext
    • setMatchingMetadata

      public void setMatchingMetadata(HandlerMatchingMetadata handlerMatchingMetadata)
      覆盖:
      setMatchingMetadata 在类中 RequestContext
    • hasMatchingMetadata

      public boolean hasMatchingMetadata()
      覆盖:
      hasMatchingMetadata 在类中 RequestContext
    • getAttribute

      public Object getAttribute(String name)
      指定者:
      getAttribute 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      getAttribute 在类中 cn.taketoday.core.AttributeAccessorSupport
    • setAttribute

      public void setAttribute(String name, Object value)
      指定者:
      setAttribute 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      setAttribute 在类中 cn.taketoday.core.AttributeAccessorSupport
    • removeAttribute

      public Object removeAttribute(String name)
      指定者:
      removeAttribute 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      removeAttribute 在类中 cn.taketoday.core.AttributeAccessorSupport
    • clearAttributes

      public void clearAttributes()
      指定者:
      clearAttributes 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      clearAttributes 在类中 cn.taketoday.core.AttributeAccessorSupport
    • getAttributeNames

      public String[] getAttributeNames()
      指定者:
      getAttributeNames 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      getAttributeNames 在类中 cn.taketoday.core.AttributeAccessorSupport
    • writeHeaders

      public void writeHeaders()
      从类复制的说明: RequestContext
      write headers to response
      覆盖:
      writeHeaders 在类中 RequestContext
    • flush

      public void flush() throws IOException
      从类复制的说明: RequestContext
      Forces any content in the buffer to be written to the client. A call to this method automatically commits the response, meaning the status code and headers will be written. Ensure that the headers and the content of the response are written out.

      After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.

      覆盖:
      flush 在类中 RequestContext
      抛出:
      IOException - if the act of flushing the buffer cannot be completed.
      另请参阅:
    • requestCompleted

      public void requestCompleted()
      从类复制的说明: RequestContext
      Signal that the request has been completed.

      Executes all request destruction callbacks and other resources cleanup

      覆盖:
      requestCompleted 在类中 RequestContext
    • requestCompleted

      public void requestCompleted(@Nullable Throwable notHandled)
      从类复制的说明: RequestContext
      Signal that the request has been completed.

      Executes all request destruction callbacks and other resources cleanup

      覆盖:
      requestCompleted 在类中 RequestContext
      参数:
      notHandled - exception not handled
    • createMultipartRequest

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

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

      public AsyncWebRequest getAsyncWebRequest()
      覆盖:
      getAsyncWebRequest 在类中 RequestContext
    • isConcurrentHandlingStarted

      public boolean isConcurrentHandlingStarted()
      从类复制的说明: RequestContext
      Whether the selected handler for the current request chose to handle the request asynchronously. A return value of "true" indicates concurrent handling is under way and the response will remain open. A return value of "false" means concurrent handling was either not started or possibly that it has completed and the request was dispatched for further processing of the concurrent result.
      覆盖:
      isConcurrentHandlingStarted 在类中 RequestContext
    • getMultipartRequest

      public MultipartRequest getMultipartRequest()
      覆盖:
      getMultipartRequest 在类中 RequestContext
      另请参阅:
    • setBinding

      public void setBinding(BindingContext bindingContext)
      覆盖:
      setBinding 在类中 RequestContext
    • getBinding

      public BindingContext getBinding()
      覆盖:
      getBinding 在类中 RequestContext
    • binding

      public BindingContext binding()
      覆盖:
      binding 在类中 RequestContext
    • hasBinding

      public boolean hasBinding()
      覆盖:
      hasBinding 在类中 RequestContext
    • getInputRedirectModel

      @Nullable public RedirectModel getInputRedirectModel()
      从类复制的说明: RequestContext
      Return read-only "input" flash attributes from request before redirect.
      覆盖:
      getInputRedirectModel 在类中 RequestContext
      返回:
      a RedirectModel, or null if not found
      另请参阅:
    • getInputRedirectModel

      @Nullable public RedirectModel getInputRedirectModel(@Nullable RedirectModelManager manager)
      从类复制的说明: RequestContext
      Return read-only "input" flash attributes from request before redirect.
      覆盖:
      getInputRedirectModel 在类中 RequestContext
      参数:
      manager - RedirectModelManager manage RedirectModel
      返回:
      a RedirectModel, or null if not found
      另请参阅:
    • computeAttribute

      public <T> T computeAttribute(String name, Function<String,T> computeFunction)
      指定者:
      computeAttribute 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      computeAttribute 在类中 cn.taketoday.core.AttributeAccessorSupport
    • hasAttribute

      public boolean hasAttribute(String name)
      指定者:
      hasAttribute 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      hasAttribute 在类中 cn.taketoday.core.AttributeAccessorSupport
    • attributeNames

      public Iterator<String> attributeNames()
      指定者:
      attributeNames 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      attributeNames 在类中 cn.taketoday.core.AttributeAccessorSupport
    • copyAttributesFrom

      public void copyAttributesFrom(cn.taketoday.core.AttributeAccessor source)
      指定者:
      copyAttributesFrom 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      copyAttributesFrom 在类中 cn.taketoday.core.AttributeAccessorSupport
    • hasAttributes

      public boolean hasAttributes()
      指定者:
      hasAttributes 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      hasAttributes 在类中 cn.taketoday.core.AttributeAccessorSupport
    • getAttributes

      public Map<String,Object> getAttributes()
      指定者:
      getAttributes 在接口中 cn.taketoday.core.AttributeAccessor
      覆盖:
      getAttributes 在类中 cn.taketoday.core.AttributeAccessorSupport
    • 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
      另请参阅:
    • matchingMetadata

      public HandlerMatchingMetadata matchingMetadata()
      覆盖:
      matchingMetadata 在类中 RequestContext
    • getAsyncManager

      public WebAsyncManager getAsyncManager()
      覆盖:
      getAsyncManager 在类中 RequestContext
    • setWebAsyncManagerFactory

      public void setWebAsyncManagerFactory(WebAsyncManagerFactory webAsyncManagerFactory)
      覆盖:
      setWebAsyncManagerFactory 在类中 RequestContext
    • postRequestCompleted

      public void postRequestCompleted(@Nullable Throwable notHandled)
      覆盖:
      postRequestCompleted 在类中 RequestContext
    • doGetRequestPath

      protected RequestPath doGetRequestPath()
      覆盖:
      doGetRequestPath 在类中 RequestContext
    • getDelegate

      public abstract RequestContext getDelegate()
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 cn.taketoday.core.AttributeAccessorSupport
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 cn.taketoday.core.AttributeAccessorSupport
    • toString

      public String toString()
      覆盖:
      toString 在类中 RequestContext