Class SpincastRequestRequestContextAddon<R extends RequestContext<?>>
- All Implemented Interfaces:
RequestRequestContextAddon<R>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSpincastRequestRequestContextAddon
(R requestContext, Server server, JsonManager jsonManager, XmlManager xmlManager, SpincastUtils spincastUtils, SpincastConfig spincastConfig, ETagFactory etagFactory, FlashMessagesHolder flashMessagesHolder, FormFactory formFactory, Dictionary dictionary) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
The bytes of the request's body.The raw InputStream of the request's body.The request's body as a String, using theUTF-8
encoding.The Content-Type of the request, if any.Finds the bestContent-Type
to use for a response using the"Accept"
header of the request.Gets the the request cookies values as a Map, using the names of the cookies as the keys.getCookieValue
(String name) Gets the value of a request cookie by name.Return the value of theIf-Modified-Since
header as a Date ornull
if it doesn't exist.Return the value of theIf-Unmodified-Since
header as a Date ornull
if it doesn't exist.protected Dictionary
protected ETagFactory
Returns theETags
from theIf-Match
header, if any.Returns theETags
from theIf-None-Match
header, if any.protected Object
Gets the Flash message, if any.protected FlashMessage
getFlashMessage
(boolean removeIt) protected FlashMessagesHolder
Gets the part of the submittedFORM
body that is scoped by the specifiedroot key
.protected Form
The data submitted as aFORM
body (in general via aPOST
method), as an immutableJsonObject
.The data submitted as aFORM
body (in general via aPOST
method), as aMap
.protected Pattern
protected FormFactory
getFormOrCreate
(String rootKey) Gets the part of the submittedFORM
body that is scoped by the specifiedroot key
.Returns the current full URL, including the queryString, if any.getFullUrl
(boolean keepCacheBusters) Returns the current full URL, including the queryString, if any.If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one.getFullUrlOriginal
(boolean keepCacheBusters) If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one.protected String
protected String
If a reverse proxy has been used, this URL will contain thescheme
,host
andport
as forwarded by the reserve proxy, not as seen by the user.getFullUrlProxied
(boolean keepCacheBusters) If a reverse proxy has been used, this URL will contain thescheme
,host
andport
as forwarded by the reserve proxy, not as seen by the user.protected String
protected String
Returns the values of the specified header from the current request or an empty list if not found.getHeaderFirst
(String name) The first value of the specified header from the current request.Returns all headers of the current request.Gets the request'sHTTP method
.getIp()
Gets the IP of the current request.The request's body deserialized to an immutableJsonObject
.<T> T
getJsonBody
(Class<T> clazz) The request's body deserialized to the specifiedclass
.The request's body deserialized to aMap<String, Object>
.protected JsonManager
Find what the request tells should be the bestLocale
to use for a response, by looking at the"Accept-Language"
header.getPathParam
(String name) A specific value parsed from a dynamic parameter of the route path.The values parsed from the dynamic parameters of the route path.getQueryString
(boolean withQuestionMark) The queryString of the request.getQueryStringParam
(String name) A specific parameter taken from the queryString of the request.The first (and often only) value of a specific parameter taken from the queryString of the request.The parameters taken from the queryString of the request.protected R
The path of the request (no querystring).getRequestPath
(boolean keepCacheBusters) The path of the request (no querystring).protected Server
protected SpincastConfig
protected SpincastUtils
getStringBody
(String encoding) The request's body as a String, using the specified encoding.getUploadedFileFirst
(String name) The uploaded files of the specified HTML'sname
attribute.The key of the map if the HTML'sname
attribute.getUploadedFiles
(String name) The uploaded files of the specified HTML'sname
attribute.<T> T
getXmlBody
(Class<T> clazz) The request's body deserialized to the specifiedclass
.The request's body deserialized to an immutableJsonObject
.The request's body deserialized to aMap<String, Object>
.protected XmlManager
boolean
Did we validate that the current user has cookies enabled?boolean
Is there a Flash message?boolean
Will returntrue
if the request specifies thatHTML
is the most appropriate format to return.boolean
isHttps()
Is the request a secure HTTPS one?boolean
Will returntrue
if the request specifies thatJson
is the most appropriate format to return.boolean
Will returntrue
if the request specifies thatplain-text
is the most appropriate format to return.boolean
Will returntrue
if the request specifies thatXML
is the most appropriate format to return.protected Date
parseDateHeader
(String headerName) Returns NULL if the date is not there or not parsable.parseETagHeader
(String headerName) protected void
void
protected void
protected void
parseUrl()
protected void
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
SpincastRequestRequestContextAddon
@Inject public SpincastRequestRequestContextAddon(R requestContext, Server server, JsonManager jsonManager, XmlManager xmlManager, SpincastUtils spincastUtils, SpincastConfig spincastConfig, ETagFactory etagFactory, FlashMessagesHolder flashMessagesHolder, FormFactory formFactory, Dictionary dictionary)
-
-
Method Details
-
getRequestContext
-
getServer
-
getJsonManager
-
getXmlManager
-
getSpincastUtils
-
getSpincastConfig
-
getEtagFactory
-
getFlashMessagesHolder
-
getFormFactory
-
getDictionary
-
getExchange
-
getHttpMethod
Description copied from interface:RequestRequestContextAddon
Gets the request'sHTTP method
.- Specified by:
getHttpMethod
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getContentTypeBestMatch
Description copied from interface:RequestRequestContextAddon
Finds the bestContent-Type
to use for a response using the"Accept"
header of the request. It will fallback toContentTypeDefaults.TEXT
if nothing more specific is found.- Specified by:
getContentTypeBestMatch
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
isJsonShouldBeReturn
public boolean isJsonShouldBeReturn()Description copied from interface:RequestRequestContextAddon
Will returntrue
if the request specifies thatJson
is the most appropriate format to return.- Specified by:
isJsonShouldBeReturn
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
isHTMLShouldBeReturn
public boolean isHTMLShouldBeReturn()Description copied from interface:RequestRequestContextAddon
Will returntrue
if the request specifies thatHTML
is the most appropriate format to return.- Specified by:
isHTMLShouldBeReturn
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
isXMLShouldBeReturn
public boolean isXMLShouldBeReturn()Description copied from interface:RequestRequestContextAddon
Will returntrue
if the request specifies thatXML
is the most appropriate format to return.- Specified by:
isXMLShouldBeReturn
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
isPlainTextShouldBeReturn
public boolean isPlainTextShouldBeReturn()Description copied from interface:RequestRequestContextAddon
Will returntrue
if the request specifies thatplain-text
is the most appropriate format to return.- Specified by:
isPlainTextShouldBeReturn
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFormDataArrayPattern
-
getCookieValue
Description copied from interface:RequestRequestContextAddon
Gets the value of a request cookie by name.- Specified by:
getCookieValue
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the value or
null
if not found.
-
getCookiesValues
Description copied from interface:RequestRequestContextAddon
Gets the the request cookies values as a Map, using the names of the cookies as the keys.- Specified by:
getCookiesValues
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
isCookiesEnabledValidated
public boolean isCookiesEnabledValidated()Description copied from interface:RequestRequestContextAddon
Did we validate that the current user has cookies enabled?- Specified by:
isCookiesEnabledValidated
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getHeaders
Description copied from interface:RequestRequestContextAddon
Returns all headers of the current request. A single header can have multiple values. The implementation is aTreeMap
which iscase insensitive for the keys. The map is immutable.- Specified by:
getHeaders
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getHeader
Description copied from interface:RequestRequestContextAddon
Returns the values of the specified header from the current request or an empty list if not found.The
name
is case insensitive.The list is immutable.
- Specified by:
getHeader
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getHeaderFirst
Description copied from interface:RequestRequestContextAddon
The first value of the specified header from the current request.The
name
is case insensitive.Returns
null
if the header is not found.- Specified by:
getHeaderFirst
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFullUrlOriginalNoCacheBustersNonDecoded
-
getFullUrlOriginalWithCacheBustersNonDecoded
-
getFullUrlProxiedNoCacheBustersNonDecoded
-
getFullUrlProxiedWithCacheBustersNonDecoded
-
getFullUrlOriginal
Description copied from interface:RequestRequestContextAddon
If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one. Cache buster codes are removed, if there were any.Use
getFullUrl()
to get the current, potentially forwarded URL.If a reverse proxy has been used, this URL will contain the
scheme
,host
andport
from the original URL, as seen by the user. In general, this is what you want to use in your application.- Specified by:
getFullUrlOriginal
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFullUrlOriginal
Description copied from interface:RequestRequestContextAddon
If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one.Use
getFullUrl()
to get the current, potentially forwarded URL.If a reverse proxy has been used, this URL will contain the
scheme
,host
andport
from the original URL, as seen by the user. In general, this is what you want to use in your application.- Specified by:
getFullUrlOriginal
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Parameters:
keepCacheBusters
- iftrue
, the returned URL will contain the cache buster codes, if there were any. The default behavior is to automatically remove them.
-
getFullUrlProxied
Description copied from interface:RequestRequestContextAddon
If a reverse proxy has been used, this URL will contain thescheme
,host
andport
as forwarded by the reserve proxy, not as seen by the user. Cache buster codes are removed, if there were any.If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one.
In general, you should probably use
getFullUrl()
orgetFullUrlOriginal()
instead of this one.- Specified by:
getFullUrlProxied
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFullUrlProxied
Description copied from interface:RequestRequestContextAddon
If a reverse proxy has been used, this URL will contain thescheme
,host
andport
as forwarded by the reserve proxy, not as seen by the user. Cache buster codes are removed, if there were any.If the request has been forwarded, this is going to return the original URL, not the current, forwarded, one.
In general, you should probably use
getFullUrl()
orgetFullUrlOriginal()
instead of this one.- Specified by:
getFullUrlProxied
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Parameters:
keepCacheBusters
- iftrue
, the returned URL will contain the cache buster codes, if there were any. The default behavior is to automatically remove them.
-
getFullUrl
Description copied from interface:RequestRequestContextAddon
Returns the current full URL, including the queryString, if any. Cache buster codes are removed, if there were any.In case the request has been forwarded, this will be the *new*, the current URL. Use
getFullUrlOriginal()
to get the original URL, before the request was forwarded.If a reverse proxy has been used, this URL will contain the
scheme
,host
andport
from the original URL, as seen by the user. In general, this is what you want to use in your application.- Specified by:
getFullUrl
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFullUrl
Description copied from interface:RequestRequestContextAddon
Returns the current full URL, including the queryString, if any.In case the request has been forwarded, this will be the *new*, the current URL. Use
getFullUrlOriginal()
to get the original URL, before the request was forwarded.If a reverse proxy has been used, this URL will contain the
scheme
,host
andport
from the original URL, as seen by the user. In general, this is what you want to use in your application.- Specified by:
getFullUrl
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Parameters:
keepCacheBusters
- iftrue
, the returned URL will contain the cache buster codes, if there were any. The default behavior is to automatically remove them.
-
validateFullUrlInfoCache
protected void validateFullUrlInfoCache() -
parseUrl
protected void parseUrl() -
parseRequestPath
protected void parseRequestPath() -
parseQueryString
protected void parseQueryString() -
parseQueryStringParams
public void parseQueryStringParams() -
getRequestPath
Description copied from interface:RequestRequestContextAddon
The path of the request (no querystring).- Specified by:
getRequestPath
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getRequestPath
Description copied from interface:RequestRequestContextAddon
The path of the request (no querystring).- Specified by:
getRequestPath
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Parameters:
keepCacheBusters
- iftrue
, the returned path will contain the cache buster codes, if there were any. The default behavior is to automatically remove them.
-
getQueryString
Description copied from interface:RequestRequestContextAddon
The queryString of the request. Returns an empty String if there is no queryString.- Specified by:
getQueryString
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Parameters:
withQuestionMark
- iftrue
and the queryString is not empty, the result will be prefixed with "?".
-
getQueryStringParams
Description copied from interface:RequestRequestContextAddon
The parameters taken from the queryString of the request. A queryString parameter may have multiple values. Returns an empty list if there is no queryString. The map is immutable.- Specified by:
getQueryStringParams
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getQueryStringParam
Description copied from interface:RequestRequestContextAddon
A specific parameter taken from the queryString of the request. A queryString parameter may have multiple values. Returns an empty list if the parameter doesn't exist. The list is immutable.- Specified by:
getQueryStringParam
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getQueryStringParamFirst
Description copied from interface:RequestRequestContextAddon
The first (and often only) value of a specific parameter taken from the queryString of the request. Returnsnull
if the parameter doesn't exist.- Specified by:
getQueryStringParamFirst
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getPathParams
Description copied from interface:RequestRequestContextAddon
The values parsed from the dynamic parameters of the route path. The map is immutable.- Specified by:
getPathParams
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getPathParam
Description copied from interface:RequestRequestContextAddon
A specific value parsed from a dynamic parameter of the route path. Thename
is case sensitive, since you have easy control over it.- Specified by:
getPathParam
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the path param value or
null
if not found.
-
getBodyAsInputStream
Description copied from interface:RequestRequestContextAddon
The raw InputStream of the request's body. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getBodyAsInputStream
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getBodyAsString
Description copied from interface:RequestRequestContextAddon
The request's body as a String, using theUTF-8
encoding. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getBodyAsString
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getStringBody
Description copied from interface:RequestRequestContextAddon
The request's body as a String, using the specified encoding. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getStringBody
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getBodyAsByteArray
public byte[] getBodyAsByteArray()Description copied from interface:RequestRequestContextAddon
The bytes of the request's body. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getBodyAsByteArray
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getJsonBody
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to an immutableJsonObject
. A validJson
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getJsonBody
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getJsonBodyAsMap
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to aMap<String, Object>
. A validJson
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getJsonBodyAsMap
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getJsonBody
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to the specifiedclass
. A validJson
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getJsonBody
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getXmlBodyAsJsonObject
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to an immutableJsonObject
. A validXML
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getXmlBodyAsJsonObject
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getXmlBodyAsMap
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to aMap<String, Object>
. A validXML
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getXmlBodyAsMap
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getXmlBody
Description copied from interface:RequestRequestContextAddon
The request's body deserialized to the specifiedclass
. A validXML
body is expected. Note that once part of the InputStream is read, it can't be read again!- Specified by:
getXmlBody
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFormBodyRaw
Description copied from interface:RequestRequestContextAddon
The data submitted as aFORM
body (in general via aPOST
method), as aMap
.The names are case sensitive.
This returns the keys/values as is, without trying to parse the keys as
JsonPaths
.This returns an immutable object! You won't be able to add or remove elements.
- Specified by:
getFormBodyRaw
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFormBodyAsJsonObject
Description copied from interface:RequestRequestContextAddon
The data submitted as aFORM
body (in general via aPOST
method), as an immutableJsonObject
.The root keys of the field names and are case sensitive.
The root keys will be parsed as
JsonPaths
to build the finalJsonObject
. For example :user.books[1].name
will be converted to a "user"JsonObject
with a "books" arrays with one book at index "1" and this book has a "name" property.- Specified by:
getFormBodyAsJsonObject
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- an immutable instance of
JsonObject
. If you want to get a mutable instance, you can call.clone(true)
on this object.
-
getFormOrCreate
Description copied from interface:RequestRequestContextAddon
Gets the part of the submittedFORM
body that is scoped by the specifiedroot key
.When an HTML form is submitted, there may be utility fields (such as a CSRF token, etc.) in addition to business logic fields. By using this
RequestRequestContextAddon.getFormOrCreate(String)
you only get the fields which names start with the specifiedroot key
. For example, if this HTML form was submitted:<form> <input type="text" name="csrfToken" value="12345" /> <input type="text" name="myUser.userName" value="Stromgol" /> <input type="text" name="myUser.lastNameName" value="LaPierre" /> ...
... then calling
getFormWithRootKey("myUser")
would return aForm
object containing the "userName" and the "userName" fields, but not the "csrfToken".A
Form
object is in fact aJsonObject
containing the submitted fields and aValidationSet
to store validations performed on it.The same field is returned, everytime this method is called with the same
name
.If the root key is not found in the POSTed data, an empty form will be created.
Never returns
null
.The key are case sensitive.
- Specified by:
getFormOrCreate
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getForm
Description copied from interface:RequestRequestContextAddon
Gets the part of the submittedFORM
body that is scoped by the specifiedroot key
.When an HTML form is submitted, there may be utility fields (such as a CSRF token, etc.) in addition to business logic fields. By using this
RequestRequestContextAddon.getFormOrCreate(String)
you only get the fields which names start with the specifiedroot key
. For example, if this HTML form was submitted:<form> <input type="text" name="csrfToken" value="12345" /> <input type="text" name="myUser.userName" value="Stromgol" /> <input type="text" name="myUser.lastNameName" value="LaPierre" /> ...
... then calling
getFormWithRootKey("myUser")
would return aForm
object containing the "userName" and the "userName" fields, but not the "csrfToken".A
Form
object is in fact aJsonObject
containing the submitted fields and aValidationSet
to store validations performed on it.The same field is returned, everytime this method is called with the same
name
.If the root key is not found in the POSTed data, an empty form will be created.
The key are case sensitive.
- Specified by:
getForm
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the form if it exists or
null
otherwise.
-
getForm
-
getUploadedFiles
Description copied from interface:RequestRequestContextAddon
The key of the map if the HTML'sname
attribute.More than one uploaded file with the same name is possible. The map is immutable.
Returns an empty map if there are no uploadded file.
- Specified by:
getUploadedFiles
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getUploadedFiles
Description copied from interface:RequestRequestContextAddon
The uploaded files of the specified HTML'sname
attribute.More than one uploaded file with the same
name
is possible. The list is immutable. Returns an empty list if no uploaded files of this name exists.- Specified by:
getUploadedFiles
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getUploadedFileFirst
Description copied from interface:RequestRequestContextAddon
The uploaded files of the specified HTML'sname
attribute.The first (and often only) uploaded file of the specified name.
Returns
null
if no uploaded file of this name exists.- Specified by:
getUploadedFileFirst
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getLocaleBestMatch
Description copied from interface:RequestRequestContextAddon
Find what the request tells should be the bestLocale
to use for a response, by looking at the"Accept-Language"
header.Note that this will not necessarily be the absolute best
Locale
to used for the user: it will not look at cookies or at any other ways the user may have specified its langague preference! It only look at the request itself.Use
RequestContext.getLocaleToUse()
orLocaleResolver.getLocaleToUse()
directly if you want to know the absolute bestLocale
to use for the user!- Specified by:
getLocaleBestMatch
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the default
Locale
(taken from the configurations) if nothing more specific is found on the request.
-
getContentType
Description copied from interface:RequestRequestContextAddon
The Content-Type of the request, if any.- Specified by:
getContentType
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the
Content-Type
of the request ornull
if none was specified.
-
isHttps
public boolean isHttps()Description copied from interface:RequestRequestContextAddon
Is the request a secure HTTPS one?- Specified by:
isHttps
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getEtagsFromIfMatchHeader
Description copied from interface:RequestRequestContextAddon
Returns theETags
from theIf-Match
header, if any.- Specified by:
getEtagsFromIfMatchHeader
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the
If-Match
ETags or an empty list if there is none.
-
getEtagsFromIfNoneMatchHeader
Description copied from interface:RequestRequestContextAddon
Returns theETags
from theIf-None-Match
header, if any.- Specified by:
getEtagsFromIfNoneMatchHeader
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the
If-None-Match
ETags or an empty list if there is none.
-
parseETagHeader
-
getDateFromIfModifiedSinceHeader
Description copied from interface:RequestRequestContextAddon
Return the value of theIf-Modified-Since
header as a Date ornull
if it doesn't exist.- Specified by:
getDateFromIfModifiedSinceHeader
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getDateFromIfUnmodifiedSinceHeader
Description copied from interface:RequestRequestContextAddon
Return the value of theIf-Unmodified-Since
header as a Date ornull
if it doesn't exist.- Specified by:
getDateFromIfUnmodifiedSinceHeader
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
parseDateHeader
Returns NULL if the date is not there or not parsable. -
isFlashMessageExists
public boolean isFlashMessageExists()Description copied from interface:RequestRequestContextAddon
Is there a Flash message?- Specified by:
isFlashMessageExists
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-
getFlashMessage
Description copied from interface:RequestRequestContextAddon
Gets the Flash message, if any.- Specified by:
getFlashMessage
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
- Returns:
- the Flash message or
null
if there is none.
-
getFlashMessage
-
getIp
Description copied from interface:RequestRequestContextAddon
Gets the IP of the current request.- Specified by:
getIp
in interfaceRequestRequestContextAddon<R extends RequestContext<?>>
-