Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.orchestra.lib.jsf
Class ExternalContextUtils

    java.lang.Object
      org.apache.myfaces.orchestra.lib.jsf.ExternalContextUtils

    public final class ExternalContextUtils

extends java.lang.Object

TODO: This class is a copy of org.apache.myfaces.commons.util.ExternalContextUtils Since orchestra should be compatible with 1.1, this is placed here and there is not a dependency for myfaces-commons-utils, because this stuff only works for 1.2 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.

Since:
  1.4

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.
`static RequestType` | `getRequestType(java.lang.Object context, java.lang.Object request)` This method is used when a ExternalContext object is not available, like in TomahawkFacesContextFactory.

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`

### getRequestType

    public static final RequestType getRequestType(java.lang.Object context,
                                                   java.lang.Object request)

  This method is used when a ExternalContext object is not available, like in TomahawkFacesContextFactory. According to TOMAHAWK-1331, the object context could receive an instance of javax.portlet.PortletContext or javax.portlet.PortletConfig, so we check both cases.

  Parameters:
    `context` -
    `request` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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