org.apache.myfaces.commons.util
Class ExternalContextUtils

java.lang.Object
  extended by org.apache.myfaces.commons.util.ExternalContextUtils

public final class ExternalContextUtils
extends java.lang.Object

This provides some functionality for determining some things about the native request object that is not provided by JSF. This class is useful for use in places where Portlet API's may or may not be present and can also provide access to some request-specific items which are not available on the JSF ExternalContext. If portlet API's are not present, this class simply handles the Servlet Request type.


Method Summary
static int getContentLength(javax.faces.context.ExternalContext externalContext)
          Returns the content length or -1 if the unknown.
static java.io.InputStream getRequestInputStream(javax.faces.context.ExternalContext externalContext)
          Returns the request input stream if one is available
static RequestType getRequestType(javax.faces.context.ExternalContext externalContext)
          Returns the requestType of this ExternalContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContentLength

public static final int getContentLength(javax.faces.context.ExternalContext externalContext)
Returns the content length or -1 if the unknown.

Parameters:
externalContext - the ExternalContext
Returns:
the length or -1

getRequestInputStream

public static final java.io.InputStream getRequestInputStream(javax.faces.context.ExternalContext externalContext)
                                                       throws java.io.IOException
Returns the request input stream if one is available

Parameters:
externalContext -
Returns:
Throws:
java.io.IOException

getRequestType

public static final RequestType getRequestType(javax.faces.context.ExternalContext externalContext)
Returns the requestType of this ExternalContext.

Parameters:
externalContext - the current external context
Returns:
the appropriate RequestType for this external context
See Also:
RequestType


Copyright © 2007-2008 The Apache Software Foundation. All Rights Reserved.