Top Description Fields Constructors Methods
jakarta.faces.context

public abstract Class ExternalContextWrapper

extends ExternalContext
implements FacesWrapper<ExternalContext>
Class Inheritance
All Implemented Interfaces
jakarta.faces.FacesWrapper
Imports
java.io.IOException, .InputStream, .OutputStream, .UnsupportedEncodingException, .Writer, java.net.MalformedURLException, .URL, java.security.Principal, java.util.Iterator, .List, .Locale, .Map, .Set, jakarta.faces.FacesWrapper, jakarta.faces.lifecycle.ClientWindow

Provides a simple implementation of ExternalContext that can be subclassed by developers wishing to provide specialized behavior to an existing ExternalContext instance. The default implementation of all methods is to call through to the wrapped ExternalContext instance.

Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Since
2.0

Field Summary

Modifier and TypeField and Description
private ExternalContext
Inherited from jakarta.faces.context.ExternalContext:
BASIC_AUTHCLIENT_CERT_AUTHDIGEST_AUTHFORM_AUTH

Constructor Summary

AccessConstructor and Description
public
ExternalContextWrapper()

Deprecated Use the other constructor taking the implementation being wrapped.
public
ExternalContextWrapper(ExternalContext
The implementation being wrapped.
wrapped
)

If this external context has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addResponseCookie(String
To be passed as the first argument to the Cookie constructor.
name
,
String
To be passed as the second argument to the Cookie constructor.
value
,
Map<String, Object>
A Map containg key/value pairs to be passed as arguments to the setter methods as described above.
properties
)

Overrides jakarta.faces.context.ExternalContext.addResponseCookie.

The default behavior of this method is to call ExternalContext#addResponseCookie(String, String, Map) on the wrapped ExternalContext object.

public void
addResponseHeader(String
The name of the response header.
name
,
String
The value of the response header.
value
)

Overrides jakarta.faces.context.ExternalContext.addResponseHeader.

The default behavior of this method is to call ExternalContext#addResponseHeader(String, String) on the wrapped ExternalContext object.

public void
dispatch(String
Context relative path to the specified resource, which must start with a slash ("/") character
path
)

Implements abstract jakarta.faces.context.ExternalContext.dispatch.

The default behavior of this method is to call ExternalContext#dispatch(String) on the wrapped ExternalContext object.

public String
encodeActionURL(String
The input URL to be encoded
url
)

Implements abstract jakarta.faces.context.ExternalContext.encodeActionURL.

The default behavior of this method is to call ExternalContext#encodeActionURL(String) on the wrapped ExternalContext object.

public String
encodeBookmarkableURL(String
The base URL onto which the query string generated by this method will be appended. The URL may contain query parameters.
baseUrl
,
Map<String, List<String>>
The collection of Parameter objects, representing name=value pairs that are used to produce a query string
parameters
)

Overrides jakarta.faces.context.ExternalContext.encodeBookmarkableURL.

The default behavior of this method is to call jakarta.faces.context.ExternalContext#encodeBookmarkableURL(String, java.util.Map) on the wrapped ExternalContext object.

public String
encodeNamespace(String
Name to be encoded
name
)

Implements abstract jakarta.faces.context.ExternalContext.encodeNamespace.

The default behavior of this method is to call ExternalContext#encodeNamespace(String) on the wrapped ExternalContext object.

public String
encodePartialActionURL(String
The input URL to be encoded
url
)

Overrides jakarta.faces.context.ExternalContext.encodePartialActionURL.

The default behavior of this method is to call ExternalContext#encodePartialActionURL(String) on the wrapped ExternalContext object.

public String
encodeRedirectURL(String
The base URL onto which the query string generated by this method will be appended. The URL may contain query parameters.
baseUrl
,
Map<String, List<String>>
The collection of Parameter objects, representing name=value pairs that are used to produce a query string
parameters
)

Overrides jakarta.faces.context.ExternalContext.encodeRedirectURL.

The default behavior of this method is to call jakarta.faces.context.ExternalContext#encodeRedirectURL(String, java.util.Map) on the wrapped ExternalContext object.

public String
encodeResourceURL(String
The input URL to be encoded
url
)

Implements abstract jakarta.faces.context.ExternalContext.encodeResourceURL.

The default behavior of this method is to call ExternalContext#encodeResourceURL(String) on the wrapped ExternalContext object.

public String
encodeWebsocketURL(String
The input URL to be encoded.
url
)

Implements abstract jakarta.faces.context.ExternalContext.encodeWebsocketURL.

The default behavior of this method is to call ExternalContext#encodeWebsocketURL(String) on the wrapped ExternalContext object.

public String
public Map<String, Object>
getApplicationMap()

Implements abstract jakarta.faces.context.ExternalContext.getApplicationMap.

The default behavior of this method is to call ExternalContext#getApplicationMap on the wrapped ExternalContext object.

public String
getAuthType()

Implements abstract jakarta.faces.context.ExternalContext.getAuthType.

The default behavior of this method is to call ExternalContext#getAuthType on the wrapped ExternalContext object.

public ClientWindow
getClientWindow()

Overrides jakarta.faces.context.ExternalContext.getClientWindow.

The default behavior of this method is to call ExternalContext#getClientWindow on the wrapped ExternalContext object.

public Object
getContext()

Implements abstract jakarta.faces.context.ExternalContext.getContext.

The default behavior of this method is to call ExternalContext#getContext on the wrapped ExternalContext object.

public String
getContextName()

Overrides jakarta.faces.context.ExternalContext.getContextName.

The default behavior of this method is to call ExternalContext#getContextName on the wrapped ExternalContext object.

public Flash
getFlash()

Overrides jakarta.faces.context.ExternalContext.getFlash.

The default behavior of this method is to call ExternalContext#getFlash() on the wrapped ExternalContext object.

public String
getInitParameter(String
Name of the requested initialization parameter
name
)

Implements abstract jakarta.faces.context.ExternalContext.getInitParameter.

The default behavior of this method is to call ExternalContext#getInitParameter(String) on the wrapped ExternalContext object.

public Map<K, V>
getInitParameterMap()

Implements abstract jakarta.faces.context.ExternalContext.getInitParameterMap.

The default behavior of this method is to call ExternalContext#getInitParameterMap on the wrapped ExternalContext object.

public String
getMimeType(String
The file for which the mime type should be obtained.
file
)

Overrides jakarta.faces.context.ExternalContext.getMimeType.

The default behavior of this method is to call ExternalContext#getMimeType(String) on the wrapped ExternalContext object.

public String
getRealPath(String
The context of the requested initialization parameter
path
)

Overrides jakarta.faces.context.ExternalContext.getRealPath.

The default behavior of this method is to call ExternalContext#getRealPath(String) on the wrapped ExternalContext object.

public String
getRemoteUser()

Implements abstract jakarta.faces.context.ExternalContext.getRemoteUser.

The default behavior of this method is to call ExternalContext#getRemoteUser on the wrapped ExternalContext object.

public Object
getRequest()

Implements abstract jakarta.faces.context.ExternalContext.getRequest.

The default behavior of this method is to call ExternalContext#getRequest on the wrapped ExternalContext object.

public String
public int
public String
public String
getRequestContextPath()

Implements abstract jakarta.faces.context.ExternalContext.getRequestContextPath.

The default behavior of this method is to call ExternalContext#getRequestContextPath on the wrapped ExternalContext object.

public Map<String, Object>
getRequestCookieMap()

Implements abstract jakarta.faces.context.ExternalContext.getRequestCookieMap.

The default behavior of this method is to call ExternalContext#getRequestCookieMap on the wrapped ExternalContext object.

public Map<String, String>
getRequestHeaderMap()

Implements abstract jakarta.faces.context.ExternalContext.getRequestHeaderMap.

The default behavior of this method is to call ExternalContext#getRequestHeaderMap on the wrapped ExternalContext object.

public Map<String, String[]>
getRequestHeaderValuesMap()

Implements abstract jakarta.faces.context.ExternalContext.getRequestHeaderValuesMap.

The default behavior of this method is to call ExternalContext#getRequestHeaderValuesMap on the wrapped ExternalContext object.

public Locale
getRequestLocale()

Implements abstract jakarta.faces.context.ExternalContext.getRequestLocale.

The default behavior of this method is to call ExternalContext#getRequestLocale on the wrapped ExternalContext object.

public Iterator<Locale>
getRequestLocales()

Implements abstract jakarta.faces.context.ExternalContext.getRequestLocales.

The default behavior of this method is to call ExternalContext#getRequestLocales on the wrapped ExternalContext object.

public Map<String, Object>
getRequestMap()

Implements abstract jakarta.faces.context.ExternalContext.getRequestMap.

The default behavior of this method is to call ExternalContext#getRequestMap on the wrapped ExternalContext object.

public Map<String, String>
getRequestParameterMap()

Implements abstract jakarta.faces.context.ExternalContext.getRequestParameterMap.

The default behavior of this method is to call ExternalContext#getRequestParameterMap on the wrapped ExternalContext object.

public Iterator<String>
getRequestParameterNames()

Implements abstract jakarta.faces.context.ExternalContext.getRequestParameterNames.

The default behavior of this method is to call ExternalContext#getRequestParameterNames on the wrapped ExternalContext object.

public Map<String, String[]>
public String
getRequestPathInfo()

Implements abstract jakarta.faces.context.ExternalContext.getRequestPathInfo.

The default behavior of this method is to call ExternalContext#getRequestPathInfo on the wrapped ExternalContext object.

public String
getRequestScheme()

Overrides jakarta.faces.context.ExternalContext.getRequestScheme.

The default behavior of this method is to call ExternalContext#getRequestScheme on the wrapped ExternalContext object.

public String
getRequestServerName()

Overrides jakarta.faces.context.ExternalContext.getRequestServerName.

The default behavior of this method is to call ExternalContext#getRequestServerName on the wrapped ExternalContext object.

public int
getRequestServerPort()

Overrides jakarta.faces.context.ExternalContext.getRequestServerPort.

The default behavior of this method is to call ExternalContext#getRequestServerPort on the wrapped ExternalContext object.

public String
getRequestServletPath()

Implements abstract jakarta.faces.context.ExternalContext.getRequestServletPath.

The default behavior of this method is to call ExternalContext#getRequestServletPath on the wrapped ExternalContext object.

public URL
getResource(String
The path to the requested resource, which must start with a slash ("/" character
path
)

Implements abstract jakarta.faces.context.ExternalContext.getResource.

The default behavior of this method is to call ExternalContext#getResource(String) on the wrapped ExternalContext object.

public InputStream
getResourceAsStream(String
The path to the requested resource, which must start with a slash ("/" character
path
)

Implements abstract jakarta.faces.context.ExternalContext.getResourceAsStream.

The default behavior of this method is to call ExternalContext#getResourceAsStream(String) on the wrapped ExternalContext object.

public Set<String>
getResourcePaths(String
Partial path used to match resources, which must start with a slash ("/") character
path
)

Implements abstract jakarta.faces.context.ExternalContext.getResourcePaths.

The default behavior of this method is to call ExternalContext#getResourcePaths(String) on the wrapped ExternalContext object.

public Object
getResponse()

Implements abstract jakarta.faces.context.ExternalContext.getResponse.

The default behavior of this method is to call ExternalContext#getResponse on the wrapped ExternalContext object.

public int
public String
public String
public OutputStream
public Writer
public Object
getSession(boolean
Flag indicating whether or not a new session should be created if there is no session associated with the current request
create
)

Implements abstract jakarta.faces.context.ExternalContext.getSession.

The default behavior of this method is to call ExternalContext#getSession(boolean) on the wrapped ExternalContext object.

public String
getSessionId(boolean
Flag indicating whether or not a new session should be created if there is no session associated with the current request
create
)

Overrides jakarta.faces.context.ExternalContext.getSessionId.

The default behavior of this method is to call ExternalContext#getSessionId(boolean) on the wrapped ExternalContext object.

public Map<String, Object>
getSessionMap()

Implements abstract jakarta.faces.context.ExternalContext.getSessionMap.

The default behavior of this method is to call ExternalContext#getSessionMap() on the wrapped ExternalContext object.

public int
public Principal
getUserPrincipal()

Implements abstract jakarta.faces.context.ExternalContext.getUserPrincipal.

The default behavior of this method is to call ExternalContext#getUserPrincipal on the wrapped ExternalContext object.

public ExternalContext
getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

public void
invalidateSession()

Overrides jakarta.faces.context.ExternalContext.invalidateSession.

The default behavior of this method is to call ExternalContext#invalidateSession on the wrapped ExternalContext object.

public boolean
isResponseCommitted()

Overrides jakarta.faces.context.ExternalContext.isResponseCommitted.

The default behavior of this method is to call ExternalContext#isResponseCommitted() on the wrapped ExternalContext object.

public boolean
isSecure()

Overrides jakarta.faces.context.ExternalContext.isSecure.

The default behavior of this method is to call ExternalContext#isSecure on the wrapped ExternalContext object.

public boolean
isUserInRole(String
Logical role name to be checked
role
)

Implements abstract jakarta.faces.context.ExternalContext.isUserInRole.

The default behavior of this method is to call ExternalContext#isUserInRole(String) on the wrapped ExternalContext object.

public void
log(String
Message to be logged
message
)

Implements abstract jakarta.faces.context.ExternalContext.log.

The default behavior of this method is to call ExternalContext#log(String) on the wrapped ExternalContext object.

public void
log(String
Message to be logged
message
,
Throwable
Exception to be logged
exception
)

Implements abstract jakarta.faces.context.ExternalContext.log.

The default behavior of this method is to call ExternalContext#log(String, Throwable) on the wrapped ExternalContext object.

public void
redirect(String
Absolute URL to which the client should be redirected
url
)

Implements abstract jakarta.faces.context.ExternalContext.redirect.

The default behavior of this method is to call ExternalContext#redirect(String) on the wrapped ExternalContext object.

public void
release()

Implements abstract jakarta.faces.context.ExternalContext.release.

The default behavior of this method is to call ExternalContext#release() on the wrapped ExternalContext object.

public void
public void
responseReset()

Overrides jakarta.faces.context.ExternalContext.responseReset.

The default behavior of this method is to call ExternalContext#responseReset() on the wrapped ExternalContext object.

public void
responseSendError(int
an HTTP status code
statusCode
,
String
an option message to detail the cause of the code
message
)

Overrides jakarta.faces.context.ExternalContext.responseSendError.

The default behavior of this method is to call ExternalContext#responseSendError(int, String) on the wrapped ExternalContext object.

public void
setClientWindow(ClientWindow
the window associated with this request.
window
)

Overrides jakarta.faces.context.ExternalContext.setClientWindow.

The default behavior of this method is to call ExternalContext#setClientWindow on the wrapped ExternalContext object.

public void
setRequest(Object
the request object to be set.
request
)

Overrides jakarta.faces.context.ExternalContext.setRequest.

The default behavior of this method is to call ExternalContext#setRequest(Object) on the wrapped ExternalContext object.

public void
setRequestCharacterEncoding(String
the encoding name to be set.
encoding
)

Overrides jakarta.faces.context.ExternalContext.setRequestCharacterEncoding.

The default behavior of this method is to call ExternalContext#setRequestCharacterEncoding(String) on the wrapped ExternalContext object.

public void
setResponse(Object
the response instance to be set.
response
)

Overrides jakarta.faces.context.ExternalContext.setResponse.

The default behavior of this method is to call ExternalContext#setResponse(Object) on the wrapped ExternalContext object.

public void
setResponseBufferSize(int
the new buffer size
size
)

Overrides jakarta.faces.context.ExternalContext.setResponseBufferSize.

The default behavior of this method is to call ExternalContext#setResponseBufferSize(int) on the wrapped ExternalContext object.

public void
setResponseCharacterEncoding(String
the character encoding to be sent by the current response.
encoding
)

Overrides jakarta.faces.context.ExternalContext.setResponseCharacterEncoding.

The default behavior of this method is to call ExternalContext#getResponseCharacterEncoding on the wrapped ExternalContext object.

public void
setResponseContentLength(int
the value to be set.
length
)

Overrides jakarta.faces.context.ExternalContext.setResponseContentLength.

The default behavior of this method is to call jakarta.faces.context.ExternalContext#setResponseContentLength(int) on the wrapped ExternalContext object.

public void
setResponseContentType(String
The content type to be set as the contentType of the response.
contentType
)

Overrides jakarta.faces.context.ExternalContext.setResponseContentType.

The default behavior of this method is to call ExternalContext#setResponseContentType(String) on the wrapped ExternalContext object.

public void
setResponseHeader(String
The name of the response header.
name
,
String
The value of the response header.
value
)

Overrides jakarta.faces.context.ExternalContext.setResponseHeader.

The default behavior of this method is to call ExternalContext#setResponseHeader(String, String) on the wrapped ExternalContext object.

public void
setResponseStatus(int
an HTTP status code
statusCode
)

Overrides jakarta.faces.context.ExternalContext.setResponseStatus.

The default behavior of this method is to call ExternalContext#setResponseStatus(int) on the wrapped ExternalContext object.

public void
setSessionMaxInactiveInterval(int
the value to be set.
interval
)

Overrides jakarta.faces.context.ExternalContext.setSessionMaxInactiveInterval.

The default behavior of this method is to call ExternalContext#setSessionMaxInactiveInterval(int) on the wrapped ExternalContext object.