public class HttpHeaders
extends org.springframework.http.HttpHeaders
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. |
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
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.
|
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final String CONTENT_TYPE_APPLICATION_JSON
public static final String CONTENT_TYPE_TEXT_PLAIN
public static final String CONTENT_TYPE_TEXT_HTML
public static final String CONTENT_TYPE_TEXT_XML
public static final String X_FORWARDED_FOR
X-Forwarded-For
header field namepublic static final String X_FORWARDED_PROTO
X-Forwarded-Proto
header field name.public static final String CHARSET_UTF8
public static final String PROTO_HTTPS
public static final String PROTO_HTTP
public static boolean isRequestSecure(javax.servlet.http.HttpServletRequest httpServletRequest)
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".httpServletRequest
- the HttpServletRequest
true
if the given request is secure, false
otherwisepublic static void setNoCache(javax.servlet.http.HttpServletResponse httpServletResponse)
httpServletResponse
- the HttpServletResponseCopyright © 2011–2017 aiticon GmbH. All rights reserved.