java.lang.Object
jakarta.faces.context.ExternalContext
jakarta.faces.context.ExternalContextWrapper
org.omnifaces.context.OmniExternalContext
- All Implemented Interfaces:
FacesWrapper<ExternalContext>
OmniFaces external context. This external context performs the following tasks:
- Since 2.2: Take care that the
Flashwill be ignored during an unload request. - Since 3.14.26: If the current request is an unload request from
ViewScopedcarrying the event in a request header, then return the request parameters from the request headers without parsing the request body, so that the unload also succeeds when the client aborted while the request body was still in transit.
- Since:
- 2.2
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
Fields inherited from class jakarta.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsConstructorDescriptionOmniExternalContext(ExternalContext wrapped) Construct a new OmniFaces external context around the given wrapped external context. -
Method Summary
Modifier and TypeMethodDescriptiongetFlash()If the current request is an unload request fromViewScoped, then return a dummy flash scope which does not modify the flash state.If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter map.If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the names of the request parameters from the request headers, else return the original request parameter names.If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter values map.voidsetRequest(Object request) Forget the request parameters from the request headers of the previous request.Methods inherited from class jakarta.faces.context.ExternalContextWrapper
addResponseCookie, addResponseHeader, dispatch, encodeActionURL, encodeBookmarkableURL, encodeNamespace, encodePartialActionURL, encodeRedirectURL, encodeResourceURL, encodeWebsocketURL, getApplicationContextPath, getApplicationMap, getAuthType, getClientWindow, getContext, getContextName, getInitParameter, getInitParameterMap, getMimeType, getRealPath, getRemoteUser, getRequest, getRequestCharacterEncoding, getRequestContentLength, getRequestContentType, getRequestContextPath, getRequestCookieMap, getRequestHeaderMap, getRequestHeaderValuesMap, getRequestLocale, getRequestLocales, getRequestMap, getRequestPathInfo, getRequestScheme, getRequestServerName, getRequestServerPort, getRequestServletPath, getResource, getResourceAsStream, getResourcePaths, getResponse, getResponseBufferSize, getResponseCharacterEncoding, getResponseContentType, getResponseOutputStream, getResponseOutputWriter, getSession, getSessionId, getSessionMap, getSessionMaxInactiveInterval, getUserPrincipal, getWrapped, invalidateSession, isResponseCommitted, isSecure, isUserInRole, log, log, redirect, release, responseFlushBuffer, responseReset, responseSendError, setClientWindow, setRequestCharacterEncoding, setResponse, setResponseBufferSize, setResponseCharacterEncoding, setResponseContentLength, setResponseContentLengthLong, setResponseContentType, setResponseHeader, setResponseStatus, setSessionMaxInactiveInterval
-
Constructor Details
-
OmniExternalContext
Construct a new OmniFaces external context around the given wrapped external context.- Parameters:
wrapped- The wrapped external context.
-
-
Method Details
-
getFlash
If the current request is an unload request fromViewScoped, then return a dummy flash scope which does not modify the flash state.- Overrides:
getFlashin classExternalContextWrapper
-
getRequestParameterMap
If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter map.- Overrides:
getRequestParameterMapin classExternalContextWrapper
-
getRequestParameterValuesMap
If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter values map.- Overrides:
getRequestParameterValuesMapin classExternalContextWrapper
-
getRequestParameterNames
If the current request is an unload request fromViewScopedcarrying the event in a request header, then return the names of the request parameters from the request headers, else return the original request parameter names.- Overrides:
getRequestParameterNamesin classExternalContextWrapper
-
setRequest
Forget the request parameters from the request headers of the previous request.- Overrides:
setRequestin classExternalContextWrapper
-