com.holonplatform.http.servlet

## Interface ServletHttpRequest

- All Superinterfaces:
    HttpHeaders, HttpMessage<String>, HttpRequest, Message<String,List<String>>, MessageHeaders<List<String>>

      public interface ServletHttpRequest
      extends HttpRequest

  A `HttpRequest` backed by a Servlet `HttpServletRequest`.
  Since:
    5.0.6

- - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.http.HttpHeaders

      `ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_RANGE, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, RETRY_AFTER, SCHEME_BASIC, SCHEME_BEARER, SCHEME_DIGEST, SERVER, SET_COOKIE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ServletHttpRequest` | `create(javax.servlet.http.HttpServletRequest request)` Create a new `ServletHttpRequest` using given Servlet request.
    `String` | `getContextPath()` Returns the portion of the request URI that indicates the context of the request.
    `String` | `getRequestURI()` 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.
    `Optional<String>` | `getSessionId()` Returns the id of current `HttpSession` associated with this request, if any.

    - ### Methods inherited from interface com.holonplatform.http.HttpRequest

      `getBody, getMethod, getMultiValueRequestParameter, getRequestCookie, getRequestHost, getRequestParameter, getRequestParameters, getRequestPath`

    - ### Methods inherited from interface com.holonplatform.http.HttpMessage

      `getProtocol`

    - ### Methods inherited from interface com.holonplatform.core.messaging.Message

      `getPayload, getPayloadType`

    - ### Methods inherited from interface com.holonplatform.http.HttpHeaders

      `getAuthorizationBasicCredentials, getAuthorizationBearer, getContentLength, getDate, getHeaderValue, getLocale, getLocales, getLocation`

    - ### Methods inherited from interface com.holonplatform.core.messaging.MessageHeaders

      `getHeader, getHeaders`

- - ### Method Detail

    - #### getContextPath

          String getContextPath()

      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. For servlets in the default (root) context, this method returns "".
      Returns:
        a `String` specifying the portion of the request URI that indicates the context of the request

    - #### getRequestURI

          String getRequestURI()

      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.
      Returns:
        a `String` containing the part of the URL from the protocol name up to the query string

    - #### getSessionId

          Optional<String> getSessionId()

      Returns the id of current `HttpSession` associated with this request, if any.
      Returns:
        the session id, or empty if no `HttpSession` is associated with this request

    - #### create

          static ServletHttpRequest create(javax.servlet.http.HttpServletRequest request)

      Create a new `ServletHttpRequest` using given Servlet request.
      Parameters:
        `request` - Servlet request (not null)
      Returns:
        A new `ServletHttpRequest` backed by given Servlet request

Copyright © 2019 The Holon Platform. All rights reserved.