Package org.omnifaces.context
Class OmniExternalContext
- java.lang.Object
-
- jakarta.faces.context.ExternalContext
-
- jakarta.faces.context.ExternalContextWrapper
-
- org.omnifaces.context.OmniExternalContext
-
- All Implemented Interfaces:
FacesWrapper<ExternalContext>
public class OmniExternalContext extends ExternalContextWrapper
OmniFaces external context. This external context performs the following tasks:- Since 2.2: Take care that the
Flash
will be ignored during an unload request. - Since 3.9: If
Faces.isSessionNew()
andHacks.isMojarraUsed()
then return patched flash which work arounds Mojarra issue 4431
- Since:
- 2.2
- Author:
- Bauke Scholtz
- See Also:
OmniExternalContextFactory
-
-
Field Summary
-
Fields inherited from class jakarta.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
-
Constructor Summary
Constructors Constructor Description OmniExternalContext(ExternalContext wrapped)
Construct a new OmniFaces external context around the given wrapped external context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Flash
getFlash()
If the current request is an unload request fromViewScoped
, then return a dummy flash scope which does not modify the flash state, else if Mojarra is used and session is new, then return a patched flash which work arounds Mojarra issue 4431, else return the original flash scope.-
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, getRequestParameterMap, getRequestParameterNames, getRequestParameterValuesMap, 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, responseFlushBuffer, responseReset, responseSendError, setClientWindow, setRequest, setRequestCharacterEncoding, setResponse, setResponseBufferSize, setResponseCharacterEncoding, setResponseContentLength, setResponseContentType, setResponseHeader, setResponseStatus, setSessionMaxInactiveInterval
-
-
-
-
Constructor Detail
-
OmniExternalContext
public OmniExternalContext(ExternalContext wrapped)
Construct a new OmniFaces external context around the given wrapped external context.- Parameters:
wrapped
- The wrapped external context.
-
-
Method Detail
-
getFlash
public Flash getFlash()
If the current request is an unload request fromViewScoped
, then return a dummy flash scope which does not modify the flash state, else if Mojarra is used and session is new, then return a patched flash which work arounds Mojarra issue 4431, else return the original flash scope.- Overrides:
getFlash
in classExternalContextWrapper
-
-