Class OmniExternalContext

All Implemented Interfaces:
FacesWrapper<ExternalContext>

public class OmniExternalContext extends ExternalContextWrapper
OmniFaces external context. This external context performs the following tasks:
  1. Since 2.2: Take care that the Flash will be ignored during an unload request.
  2. Since 3.14.26: If the current request is an unload request from ViewScoped carrying 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:
  • Constructor Details

    • OmniExternalContext

      public OmniExternalContext(ExternalContext wrapped)
      Construct a new OmniFaces external context around the given wrapped external context.
      Parameters:
      wrapped - The wrapped external context.
  • Method Details

    • getFlash

      public Flash getFlash()
      If the current request is an unload request from ViewScoped, then return a dummy flash scope which does not modify the flash state.
      Overrides:
      getFlash in class ExternalContextWrapper
    • getRequestParameterMap

      public Map<String,String> getRequestParameterMap()
      If the current request is an unload request from ViewScoped carrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter map.
      Overrides:
      getRequestParameterMap in class ExternalContextWrapper
    • getRequestParameterValuesMap

      public Map<String,String[]> getRequestParameterValuesMap()
      If the current request is an unload request from ViewScoped carrying the event in a request header, then return the request parameters from the request headers, else return the original request parameter values map.
      Overrides:
      getRequestParameterValuesMap in class ExternalContextWrapper
    • getRequestParameterNames

      public Iterator<String> getRequestParameterNames()
      If the current request is an unload request from ViewScoped carrying 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:
      getRequestParameterNames in class ExternalContextWrapper
    • setRequest

      public void setRequest(Object request)
      Forget the request parameters from the request headers of the previous request.
      Overrides:
      setRequest in class ExternalContextWrapper