org.apache.myfaces.context.servlet
Class ServletExternalContextImpl

java.lang.Object
  extended by javax.faces.context.ExternalContext
      extended by org.apache.myfaces.context.servlet.ServletExternalContextImplBase
          extended by org.apache.myfaces.context.servlet.ServletExternalContextImpl
All Implemented Interfaces:
ReleaseableExternalContext

public final class ServletExternalContextImpl
extends ServletExternalContextImplBase

Implements the external context for servlet request. JSF 1.2, 6.1.3

Version:
$Revision: 1215296 $ $Date: 2011-12-16 16:38:33 -0500 (Fri, 16 Dec 2011) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $), Anton Koinov

Field Summary
 
Fields inherited from class javax.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
ServletExternalContextImpl(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)
           
 
Method Summary
 void addResponseCookie(String name, String value, Map<String,Object> properties)
           
 void addResponseHeader(String name, String value)
           
 void dispatch(String requestURI)
           
 String encodeActionURL(String url)
           
 String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
           
 String encodeNamespace(String s)
           
 String encodePartialActionURL(String url)
           
 String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
           
 String encodeResourceURL(String url)
           
 String getAuthType()
           
 Flash getFlash()
           
 String getRemoteUser()
           
 Object getRequest()
           
 String getRequestCharacterEncoding()
           
 int getRequestContentLength()
           
 String getRequestContentType()
           
 String getRequestContextPath()
           
 Map<String,Object> getRequestCookieMap()
           
 Map<String,String> getRequestHeaderMap()
           
 Map<String,String[]> getRequestHeaderValuesMap()
           
 Locale getRequestLocale()
           
 Iterator<Locale> getRequestLocales()
           
 Map<String,Object> getRequestMap()
           
 Map<String,String> getRequestParameterMap()
           
 Iterator<String> getRequestParameterNames()
           
 Map<String,String[]> getRequestParameterValuesMap()
           
 String getRequestPathInfo()
           
 String getRequestScheme()
           
 String getRequestServerName()
           
 int getRequestServerPort()
           
 String getRequestServletPath()
           
 Object getResponse()
           
 int getResponseBufferSize()
           
 String getResponseCharacterEncoding()
           
 String getResponseContentType()
           
 OutputStream getResponseOutputStream()
           
 Writer getResponseOutputWriter()
           
 Object getSession(boolean create)
           
 Map<String,Object> getSessionMap()
           
 int getSessionMaxInactiveInterval()
           
 Principal getUserPrincipal()
           
 void invalidateSession()
           
 boolean isResponseCommitted()
           
 boolean isSecure()
           
 boolean isUserInRole(String role)
           
 void redirect(String url)
           
 void release()
          Release resources that the ExternalContext is holding onto.
 void responseFlushBuffer()
           
 void responseReset()
           
 void responseSendError(int statusCode, String message)
           
 void setRequest(Object request)
           
 void setRequestCharacterEncoding(String encoding)
           
 void setResponse(Object response)
           
 void setResponseBufferSize(int size)
           
 void setResponseCharacterEncoding(String encoding)
           
 void setResponseContentLength(int length)
           
 void setResponseContentType(String contentType)
           
 void setResponseHeader(String name, String value)
           
 void setResponseStatus(int statusCode)
           
 void setSessionMaxInactiveInterval(int interval)
           
 
Methods inherited from class org.apache.myfaces.context.servlet.ServletExternalContextImplBase
checkNull, getApplicationMap, getContext, getContextName, getInitParameter, getInitParameterMap, getMimeType, getRealPath, getResource, getResourceAsStream, getResourcePaths, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletExternalContextImpl

public ServletExternalContextImpl(javax.servlet.ServletContext servletContext,
                                  javax.servlet.ServletRequest servletRequest,
                                  javax.servlet.ServletResponse servletResponse)
Method Detail

release

public void release()
Description copied from interface: ReleaseableExternalContext
Release resources that the ExternalContext is holding onto.

Specified by:
release in interface ReleaseableExternalContext
Overrides:
release in class ServletExternalContextImplBase

getSession

public Object getSession(boolean create)
Specified by:
getSession in class ExternalContext

getRequest

public Object getRequest()
Specified by:
getRequest in class ExternalContext

getRequestContentLength

public int getRequestContentLength()
Overrides:
getRequestContentLength in class ExternalContext
Since:
2.0

getResponse

public Object getResponse()
Specified by:
getResponse in class ExternalContext

getResponseBufferSize

public int getResponseBufferSize()
Overrides:
getResponseBufferSize in class ExternalContext
Since:
2.0

getResponseContentType

public String getResponseContentType()
Overrides:
getResponseContentType in class ExternalContext

getResponseOutputStream

public OutputStream getResponseOutputStream()
                                     throws IOException
Overrides:
getResponseOutputStream in class ExternalContext
Throws:
IOException

getResponseOutputWriter

public Writer getResponseOutputWriter()
                               throws IOException
Overrides:
getResponseOutputWriter in class ExternalContext
Throws:
IOException
Since:
JSF 2.0

getSessionMap

public Map<String,Object> getSessionMap()
Specified by:
getSessionMap in class ExternalContext

getRequestMap

public Map<String,Object> getRequestMap()
Specified by:
getRequestMap in class ExternalContext

getRequestParameterMap

public Map<String,String> getRequestParameterMap()
Specified by:
getRequestParameterMap in class ExternalContext

getRequestParameterValuesMap

public Map<String,String[]> getRequestParameterValuesMap()
Specified by:
getRequestParameterValuesMap in class ExternalContext

getRequestServerPort

public int getRequestServerPort()
Overrides:
getRequestServerPort in class ExternalContext

getRequestParameterNames

public Iterator<String> getRequestParameterNames()
Specified by:
getRequestParameterNames in class ExternalContext

getRequestHeaderMap

public Map<String,String> getRequestHeaderMap()
Specified by:
getRequestHeaderMap in class ExternalContext

getRequestHeaderValuesMap

public Map<String,String[]> getRequestHeaderValuesMap()
Specified by:
getRequestHeaderValuesMap in class ExternalContext

getRequestCookieMap

public Map<String,Object> getRequestCookieMap()
Specified by:
getRequestCookieMap in class ExternalContext

getRequestLocale

public Locale getRequestLocale()
Specified by:
getRequestLocale in class ExternalContext

getRequestPathInfo

public String getRequestPathInfo()
Specified by:
getRequestPathInfo in class ExternalContext

getRequestContentType

public String getRequestContentType()
Overrides:
getRequestContentType in class ExternalContext

getRequestContextPath

public String getRequestContextPath()
Specified by:
getRequestContextPath in class ExternalContext

getRequestScheme

public String getRequestScheme()
Overrides:
getRequestScheme in class ExternalContext

encodeActionURL

public String encodeActionURL(String url)
Specified by:
encodeActionURL in class ExternalContext

encodeBookmarkableURL

public String encodeBookmarkableURL(String baseUrl,
                                    Map<String,List<String>> parameters)
Overrides:
encodeBookmarkableURL in class ExternalContext

encodeResourceURL

public String encodeResourceURL(String url)
Specified by:
encodeResourceURL in class ExternalContext

encodeNamespace

public String encodeNamespace(String s)
Specified by:
encodeNamespace in class ExternalContext

encodePartialActionURL

public String encodePartialActionURL(String url)
Overrides:
encodePartialActionURL in class ExternalContext

encodeRedirectURL

public String encodeRedirectURL(String baseUrl,
                                Map<String,List<String>> parameters)
Overrides:
encodeRedirectURL in class ExternalContext

dispatch

public void dispatch(String requestURI)
              throws IOException,
                     FacesException
Specified by:
dispatch in class ExternalContext
Throws:
IOException
FacesException

getRequestServerName

public String getRequestServerName()
Overrides:
getRequestServerName in class ExternalContext

getRequestServletPath

public String getRequestServletPath()
Specified by:
getRequestServletPath in class ExternalContext

getAuthType

public String getAuthType()
Specified by:
getAuthType in class ExternalContext

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in class ExternalContext

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in class ExternalContext

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in class ExternalContext

invalidateSession

public void invalidateSession()
Overrides:
invalidateSession in class ExternalContext

isResponseCommitted

public boolean isResponseCommitted()
Overrides:
isResponseCommitted in class ExternalContext
Since:
2.0

redirect

public void redirect(String url)
              throws IOException
Specified by:
redirect in class ExternalContext
Throws:
IOException

responseFlushBuffer

public void responseFlushBuffer()
                         throws IOException
Overrides:
responseFlushBuffer in class ExternalContext
Throws:
IOException
Since:
2.0

responseReset

public void responseReset()
Overrides:
responseReset in class ExternalContext
Since:
2.0

responseSendError

public void responseSendError(int statusCode,
                              String message)
                       throws IOException
Overrides:
responseSendError in class ExternalContext
Throws:
IOException
Since:
2.0

getRequestLocales

public Iterator<Locale> getRequestLocales()
Specified by:
getRequestLocales in class ExternalContext

setRequest

public void setRequest(Object request)
Overrides:
setRequest in class ExternalContext
Parameters:
request -
Since:
JSF 1.2

setRequestCharacterEncoding

public void setRequestCharacterEncoding(String encoding)
                                 throws UnsupportedEncodingException
Overrides:
setRequestCharacterEncoding in class ExternalContext
Parameters:
encoding -
Throws:
UnsupportedEncodingException
Since:
JSF 1.2

getRequestCharacterEncoding

public String getRequestCharacterEncoding()
Overrides:
getRequestCharacterEncoding in class ExternalContext
Since:
JSF 1.2

getResponseCharacterEncoding

public String getResponseCharacterEncoding()
Overrides:
getResponseCharacterEncoding in class ExternalContext
Since:
JSF 1.2

setResponse

public void setResponse(Object response)
Overrides:
setResponse in class ExternalContext
Parameters:
response -
Since:
JSF 1.2

setResponseBufferSize

public void setResponseBufferSize(int size)
Overrides:
setResponseBufferSize in class ExternalContext
Since:
2.0

setResponseCharacterEncoding

public void setResponseCharacterEncoding(String encoding)
Overrides:
setResponseCharacterEncoding in class ExternalContext
Parameters:
encoding -
Since:
JSF 1.2

setResponseContentLength

public void setResponseContentLength(int length)
Overrides:
setResponseContentLength in class ExternalContext
Since:
2.0

setResponseContentType

public void setResponseContentType(String contentType)
Overrides:
setResponseContentType in class ExternalContext

setResponseHeader

public void setResponseHeader(String name,
                              String value)
Overrides:
setResponseHeader in class ExternalContext
Since:
2.0

setResponseStatus

public void setResponseStatus(int statusCode)
Overrides:
setResponseStatus in class ExternalContext

addResponseCookie

public void addResponseCookie(String name,
                              String value,
                              Map<String,Object> properties)
Overrides:
addResponseCookie in class ExternalContext
Since:
JSF 2.0

addResponseHeader

public void addResponseHeader(String name,
                              String value)
Overrides:
addResponseHeader in class ExternalContext

getFlash

public Flash getFlash()
Overrides:
getFlash in class ExternalContext
Since:
2.0

isSecure

public boolean isSecure()
Overrides:
isSecure in class ExternalContext

getSessionMaxInactiveInterval

public int getSessionMaxInactiveInterval()
Overrides:
getSessionMaxInactiveInterval in class ExternalContext

setSessionMaxInactiveInterval

public void setSessionMaxInactiveInterval(int interval)
Overrides:
setSessionMaxInactiveInterval in class ExternalContext


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