javax.faces.context
Class ExternalContext

java.lang.Object
  extended by javax.faces.context.ExternalContext
Direct Known Subclasses:
ExternalContextWrapper

public abstract class ExternalContext
extends Object

see Javadoc of JSF Specification

Version:
$Revision: 1187700 $ $Date: 2011-10-22 07:19:37 -0500 (Sat, 22 Oct 2011) $
Author:
Manfred Geiler (latest modification by $Author: bommel $)

Field Summary
static String BASIC_AUTH
           
static String CLIENT_CERT_AUTH
           
static String DIGEST_AUTH
           
static String FORM_AUTH
           
 
Constructor Summary
ExternalContext()
           
 
Method Summary
 void addResponseCookie(String name, String value, Map<String,Object> properties)
           
 void addResponseHeader(String name, String value)
           
abstract  void dispatch(String path)
           
abstract  String encodeActionURL(String url)
           
 String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
           
abstract  String encodeNamespace(String name)
           
 String encodePartialActionURL(String url)
           
 String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
           
abstract  String encodeResourceURL(String url)
           
abstract  Map<String,Object> getApplicationMap()
           
abstract  String getAuthType()
           
abstract  Object getContext()
           
 String getContextName()
          Returns the name of the underlying context
 Flash getFlash()
           
abstract  String getInitParameter(String name)
           
abstract  Map getInitParameterMap()
           
 String getMimeType(String file)
           
 String getRealPath(String path)
           
abstract  String getRemoteUser()
           
abstract  Object getRequest()
           
 String getRequestCharacterEncoding()
           
 int getRequestContentLength()
           
 String getRequestContentType()
           
abstract  String getRequestContextPath()
           
abstract  Map<String,Object> getRequestCookieMap()
           
abstract  Map<String,String> getRequestHeaderMap()
           
abstract  Map<String,String[]> getRequestHeaderValuesMap()
           
abstract  Locale getRequestLocale()
           
abstract  Iterator<Locale> getRequestLocales()
           
abstract  Map<String,Object> getRequestMap()
           
abstract  Map<String,String> getRequestParameterMap()
           
abstract  Iterator<String> getRequestParameterNames()
           
abstract  Map<String,String[]> getRequestParameterValuesMap()
           
abstract  String getRequestPathInfo()
           
 String getRequestScheme()
           
 String getRequestServerName()
           
 int getRequestServerPort()
           
abstract  String getRequestServletPath()
           
abstract  URL getResource(String path)
           
abstract  InputStream getResourceAsStream(String path)
           
abstract  Set<String> getResourcePaths(String path)
           
abstract  Object getResponse()
           
 int getResponseBufferSize()
           
 String getResponseCharacterEncoding()
           
 String getResponseContentType()
          throws UnsupportedOperationException by default.
 OutputStream getResponseOutputStream()
           
 Writer getResponseOutputWriter()
           
abstract  Object getSession(boolean create)
           
abstract  Map<String,Object> getSessionMap()
           
abstract  Principal getUserPrincipal()
           
 void invalidateSession()
           
 boolean isResponseCommitted()
           
abstract  boolean isUserInRole(String role)
           
abstract  void log(String message)
           
abstract  void log(String message, Throwable exception)
           
abstract  void redirect(String url)
           
 void responseFlushBuffer()
           
 void responseReset()
           
 void responseSendError(int statusCode, String message)
           
 void setRequest(Object request)
          throws UnsupportedOperationException by default.
 void setRequestCharacterEncoding(String encoding)
          throws UnsupportedOperationException by default.
 void setResponse(Object response)
          throws UnsupportedOperationException by default.
 void setResponseBufferSize(int size)
           
 void setResponseCharacterEncoding(String encoding)
          throws UnsupportedOperationException by default.
 void setResponseContentLength(int length)
           
 void setResponseContentType(String contentType)
           
 void setResponseHeader(String name, String value)
           
 void setResponseStatus(int statusCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_AUTH

public static final String BASIC_AUTH
See Also:
Constant Field Values

CLIENT_CERT_AUTH

public static final String CLIENT_CERT_AUTH
See Also:
Constant Field Values

DIGEST_AUTH

public static final String DIGEST_AUTH
See Also:
Constant Field Values

FORM_AUTH

public static final String FORM_AUTH
See Also:
Constant Field Values
Constructor Detail

ExternalContext

public ExternalContext()
Method Detail

addResponseCookie

public void addResponseCookie(String name,
                              String value,
                              Map<String,Object> properties)
Parameters:
name -
value -
properties -
Since:
2.0

addResponseHeader

public void addResponseHeader(String name,
                              String value)
Parameters:
name -
value -
Since:
2.0

dispatch

public abstract void dispatch(String path)
                       throws IOException
Throws:
IOException

encodeActionURL

public abstract String encodeActionURL(String url)

encodeBookmarkableURL

public String encodeBookmarkableURL(String baseUrl,
                                    Map<String,List<String>> parameters)
Parameters:
baseUrl -
parameters -
Since:
2.0

encodeNamespace

public abstract String encodeNamespace(String name)

encodePartialActionURL

public String encodePartialActionURL(String url)
Since:
2.0

encodeRedirectURL

public String encodeRedirectURL(String baseUrl,
                                Map<String,List<String>> parameters)
Parameters:
baseUrl -
parameters -
Since:
2.0

encodeResourceURL

public abstract String encodeResourceURL(String url)

getApplicationMap

public abstract Map<String,Object> getApplicationMap()

getAuthType

public abstract String getAuthType()

getContext

public abstract Object getContext()

getContextName

public String getContextName()
Returns the name of the underlying context

Returns:
the name or null
Since:
2.0

getFlash

public Flash getFlash()
Since:
2.0

getInitParameter

public abstract String getInitParameter(String name)

getInitParameterMap

public abstract Map getInitParameterMap()

getMimeType

public String getMimeType(String file)
Since:
JSF 2.0

getRealPath

public String getRealPath(String path)
Since:
JSF 2.0

getRemoteUser

public abstract String getRemoteUser()

getRequest

public abstract Object getRequest()

getRequestCharacterEncoding

public String getRequestCharacterEncoding()

getRequestContentLength

public int getRequestContentLength()
Returns:
Since:
2.0

getRequestContentType

public String getRequestContentType()

getRequestContextPath

public abstract String getRequestContextPath()

getRequestCookieMap

public abstract Map<String,Object> getRequestCookieMap()

getRequestHeaderMap

public abstract Map<String,String> getRequestHeaderMap()

getRequestHeaderValuesMap

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

getRequestLocale

public abstract Locale getRequestLocale()

getRequestLocales

public abstract Iterator<Locale> getRequestLocales()

getRequestMap

public abstract Map<String,Object> getRequestMap()

getRequestParameterMap

public abstract Map<String,String> getRequestParameterMap()

getRequestParameterNames

public abstract Iterator<String> getRequestParameterNames()

getRequestParameterValuesMap

public abstract Map<String,String[]> getRequestParameterValuesMap()

getRequestPathInfo

public abstract String getRequestPathInfo()

getRequestScheme

public String getRequestScheme()
Since:
JSF 2.0

getRequestServerName

public String getRequestServerName()
Since:
JSF 2.0

getRequestServerPort

public int getRequestServerPort()
Since:
JSF 2.0

getRequestServletPath

public abstract String getRequestServletPath()

getResource

public abstract URL getResource(String path)
                         throws MalformedURLException
Throws:
MalformedURLException

getResourceAsStream

public abstract InputStream getResourceAsStream(String path)

getResourcePaths

public abstract Set<String> getResourcePaths(String path)

getResponse

public abstract Object getResponse()

getResponseBufferSize

public int getResponseBufferSize()
Returns:
Since:
2.0

getResponseCharacterEncoding

public String getResponseCharacterEncoding()

getResponseContentType

public String getResponseContentType()
throws UnsupportedOperationException by default.

Since:
JSF 1.2

getResponseOutputStream

public OutputStream getResponseOutputStream()
                                     throws IOException
Throws:
IOException
Since:
JSF 2.0

getResponseOutputWriter

public Writer getResponseOutputWriter()
                               throws IOException
Throws:
IOException
Since:
JSF 2.0

getSession

public abstract Object getSession(boolean create)

getSessionMap

public abstract Map<String,Object> getSessionMap()

getUserPrincipal

public abstract Principal getUserPrincipal()

invalidateSession

public void invalidateSession()
Since:
2.0

isResponseCommitted

public boolean isResponseCommitted()
Since:
2.0

isUserInRole

public abstract boolean isUserInRole(String role)

log

public abstract void log(String message)
Since:
2.0

log

public abstract void log(String message,
                         Throwable exception)
Since:
2.0

redirect

public abstract void redirect(String url)
                       throws IOException
Throws:
IOException

responseFlushBuffer

public void responseFlushBuffer()
                         throws IOException
Throws:
IOException
Since:
2.0

responseReset

public void responseReset()
Since:
2.0

responseSendError

public void responseSendError(int statusCode,
                              String message)
                       throws IOException
Parameters:
statusCode -
message -
Throws:
IOException
Since:
2.0

setRequest

public void setRequest(Object request)
throws UnsupportedOperationException by default.

Parameters:
request -
Since:
JSF 1.2

setRequestCharacterEncoding

public void setRequestCharacterEncoding(String encoding)
                                 throws UnsupportedEncodingException
throws UnsupportedOperationException by default.

Parameters:
encoding -
Throws:
UnsupportedEncodingException
Since:
JSF 1.2

setResponse

public void setResponse(Object response)
throws UnsupportedOperationException by default.

Parameters:
response -
Since:
JSF 1.2

setResponseBufferSize

public void setResponseBufferSize(int size)
Parameters:
size -
Since:
2.0

setResponseCharacterEncoding

public void setResponseCharacterEncoding(String encoding)
throws UnsupportedOperationException by default.

Parameters:
encoding -
Since:
JSF 1.2

setResponseContentLength

public void setResponseContentLength(int length)
Parameters:
length -
Since:
2.0

setResponseContentType

public void setResponseContentType(String contentType)
Parameters:
contentType -
Since:
2.0

setResponseHeader

public void setResponseHeader(String name,
                              String value)
Parameters:
name -
value -
Since:
2.0

setResponseStatus

public void setResponseStatus(int statusCode)
Parameters:
statusCode -
Since:
2.0


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.