org.appng.core.controller

## Class HttpHeaders

- java.lang.Object
- - org.springframework.http.HttpHeaders
  - - org.appng.core.controller.HttpHeaders

- All Implemented Interfaces:
    Serializable, Map<String,List<String>>, org.springframework.util.MultiValueMap<String,String>

      public class HttpHeaders
      extends org.springframework.http.HttpHeaders

  Useful constants and methods for setting HTTP-Headers as specified by RFC 2616.
  Author:
    Matthias Müller
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `Map.Entry<K,V>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CHARSET_UTF8` Constant for charset UTF-8
    `static String` | `CONTENT_TYPE_APPLICATION_JSON` The Content-Type "application/json"
    `static String` | `CONTENT_TYPE_TEXT_HTML` The Content-Type "text/html"
    `static String` | `CONTENT_TYPE_TEXT_PLAIN` The Content-Type "text/plain"
    `static String` | `CONTENT_TYPE_TEXT_XML` The Content-Type "text/xml"
    `static String` | `PROTO_HTTP` the http protocol
    `static String` | `PROTO_HTTPS` the https protocol
    `static String` | `X_FORWARDED_FOR` The HTTP `X-Forwarded-For` header field name
    `static String` | `X_FORWARDED_PROTO` The HTTP `X-Forwarded-Proto` header field name.

    - ### Fields inherited from class org.springframework.http.HttpHeaders

      `ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, 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, SERVER, SET_COOKIE, SET_COOKIE2, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getContentType(String contentType, String charSet)`
    `static boolean` | `isRequestSecure(javax.servlet.http.HttpServletRequest httpServletRequest)` Checks if the given `HttpServletRequest` is secure.
    `static void` | `setNoCache(javax.servlet.http.HttpServletResponse httpServletResponse)` Avoids caching of the page using "Cache-Control", "Pragma" and "Expires" headers.

    - ### Methods inherited from class org.springframework.http.HttpHeaders

      `add, clear, containsKey, containsValue, entrySet, equals, get, getAccept, getAcceptCharset, getAccessControlAllowCredentials, getAccessControlAllowHeaders, getAccessControlAllowMethods, getAccessControlAllowOrigin, getAccessControlExposeHeaders, getAccessControlMaxAge, getAccessControlRequestHeaders, getAccessControlRequestMethod, getAllow, getCacheControl, getConnection, getContentLength, getContentType, getDate, getETag, getETagValuesAsList, getExpires, getFieldValues, getFirst, getFirstDate, getIfMatch, getIfModifiedSince, getIfNoneMatch, getIfUnmodifiedSince, getLastModified, getLocation, getOrigin, getPragma, getRange, getUpgrade, getValuesAsList, getVary, hashCode, isEmpty, keySet, put, putAll, readOnlyHttpHeaders, remove, set, setAccept, setAcceptCharset, setAccessControlAllowCredentials, setAccessControlAllowHeaders, setAccessControlAllowMethods, setAccessControlAllowOrigin, setAccessControlExposeHeaders, setAccessControlMaxAge, setAccessControlRequestHeaders, setAccessControlRequestMethod, setAll, setAllow, setCacheControl, setConnection, setConnection, setContentDispositionFormData, setContentDispositionFormData, setContentLength, setContentType, setDate, setDate, setETag, setExpires, setIfMatch, setIfMatch, setIfModifiedSince, setIfNoneMatch, setIfNoneMatch, setIfUnmodifiedSince, setLastModified, setLocation, setOrigin, setPragma, setRange, setUpgrade, setVary, size, toCommaDelimitedString, toSingleValueMap, toString, values`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Field Detail

    - #### CONTENT_TYPE_APPLICATION_JSON

          public static final String CONTENT_TYPE_APPLICATION_JSON

      The Content-Type "application/json"
      See Also:
        Constant Field Values

    - #### CONTENT_TYPE_TEXT_PLAIN

          public static final String CONTENT_TYPE_TEXT_PLAIN

      The Content-Type "text/plain"
      See Also:
        Constant Field Values

    - #### CONTENT_TYPE_TEXT_HTML

          public static final String CONTENT_TYPE_TEXT_HTML

      The Content-Type "text/html"
      See Also:
        Constant Field Values

    - #### CONTENT_TYPE_TEXT_XML

          public static final String CONTENT_TYPE_TEXT_XML

      The Content-Type "text/xml"
      See Also:
        Constant Field Values

    - #### X_FORWARDED_FOR

          public static final String X_FORWARDED_FOR

      The HTTP `X-Forwarded-For` header field name
      See Also:
        Constant Field Values

    - #### X_FORWARDED_PROTO

          public static final String X_FORWARDED_PROTO

      The HTTP `X-Forwarded-Proto` header field name.
      See Also:
        Constant Field Values

    - #### CHARSET_UTF8

          public static final String CHARSET_UTF8

      Constant for charset UTF-8
      See Also:
        Constant Field Values

    - #### PROTO_HTTPS

          public static final String PROTO_HTTPS

      the https protocol
      See Also:
        Constant Field Values

    - #### PROTO_HTTP

          public static final String PROTO_HTTP

      the http protocol
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### isRequestSecure

          public static boolean isRequestSecure(javax.servlet.http.HttpServletRequest httpServletRequest)

      Checks if the given `HttpServletRequest` is secure. This is the case if either `ServletRequest.isSecure()` returns `true` or if the request header "X-Forwarded-Proto" has the value "https".
      Parameters:
        `httpServletRequest` - the `HttpServletRequest`
      Returns:
        `true` if the given request is secure, `false` otherwise

    - #### setNoCache

          public static void setNoCache(javax.servlet.http.HttpServletResponse httpServletResponse)

      Avoids caching of the page using "Cache-Control", "Pragma" and "Expires" headers.
      Parameters:
        `httpServletResponse` - the HttpServletResponse

    - #### getContentType

          public static String getContentType(String contentType,
                                              String charSet)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.