Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.7.0)

E10686-08

oracle.adf.share.http
Class ServletEnvironment

java.lang.Object
  extended by oracle.adf.share.Environment
      extended by oracle.adf.share.http.ServletEnvironment

public class ServletEnvironment
extends Environment


Constructor Summary
ServletEnvironment(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
           
 
Method Summary
 void clearCachedLocale()
          If the enviroment caches the locale, it should implement this method to clear the cached locale value.
 void dispatch(java.lang.String requestURI)
          Dispatch a request to the specified resource to create output for this response.
 java.lang.String encodeResourceURL(java.lang.String url)
          Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource in the current application.
 java.lang.Object getContext()
          Return the application environment object instance for the current appication.
 java.lang.Object getRequest()
          Return the environment-specific object instance for the current request.
 java.lang.String getRequestCharacterEncoding()
           
 java.lang.String getRequestContextPath()
          Return the portion of the request URI that identifies the web application context for this request.
 java.util.Locale getRequestLocale()
          Return the preferred Locale in which the client will accept content.
 java.util.Map getRequestParameterMap()
           
 java.lang.String getRequestPathInfo()
          Return the extra path information (if any) included in the request URI; otherwise, return null.
 java.lang.String getRequestQueryString()
           
 java.lang.String getRequestServletPath()
          Return the servlet path information (if any) included in the request URI; otherwise, return null.
 java.lang.String getRequestURI()
           
 java.lang.Object getResponse()
          Return the environment-specific object instance for the current response.
 java.lang.Object getSession()
           
 void redirect(java.lang.String url)
          Redirect a request to the specified URL, and cause the responseComplete() method to be called on the FacesContext instance for the current request.
 void setRequestCharacterEncoding(java.lang.String encoding)
           
 
Methods inherited from class oracle.adf.share.Environment
getContextObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletEnvironment

public ServletEnvironment(javax.servlet.ServletContext servletContext,
                          javax.servlet.ServletRequest request,
                          javax.servlet.ServletResponse response)
Method Detail

getRequest

public java.lang.Object getRequest()
Description copied from class: Environment

Return the environment-specific object instance for the current request.

Servlet: This must be the current request's javax.servlet.http.HttpServletRequest instance.

Portlet: This must be the current request's javax.portlet.PortletRequest instance, which will be either an ActionRequest or a RenderRequest depending upon when this method is called.

Specified by:
getRequest in class Environment

getSession

public java.lang.Object getSession()

getResponse

public java.lang.Object getResponse()
Description copied from class: Environment

Return the environment-specific object instance for the current response.

Servlet: This is the current request's javax.servlet.http.HttpServletResponse instance.

Portlet: This is the current request's javax.portlet.PortletResponse instance, which will be either an ActionResponse or a RenderResponse depending upon when this method is called.

Specified by:
getResponse in class Environment

getContext

public java.lang.Object getContext()
Description copied from class: Environment

Return the application environment object instance for the current appication.

Servlet: This must be the current application's javax.servlet.ServletContext instance.

Portlet: This must be the current application's javax.portlet.PortletContext instance.

Specified by:
getContext in class Environment

getRequestLocale

public java.util.Locale getRequestLocale()
Description copied from class: Environment

Return the preferred Locale in which the client will accept content.

Servlet: This must be the value returned by the javax.servlet.ServletRequest method getLocale().

Portlet: This must be the value returned by the javax.portlet.PortletRequest method getLocale().

Specified by:
getRequestLocale in class Environment

clearCachedLocale

public void clearCachedLocale()
Description copied from class: Environment
If the enviroment caches the locale, it should implement this method to clear the cached locale value.

Overrides:
clearCachedLocale in class Environment

getRequestServletPath

public java.lang.String getRequestServletPath()
Description copied from class: Environment

Return the servlet path information (if any) included in the request URI; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getServletPath().

Portlet: This must be null.

Specified by:
getRequestServletPath in class Environment

getRequestPathInfo

public java.lang.String getRequestPathInfo()
Description copied from class: Environment

Return the extra path information (if any) included in the request URI; otherwise, return null.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getPathInfo().

Portlet: This must be null.

Specified by:
getRequestPathInfo in class Environment

encodeResourceURL

public java.lang.String encodeResourceURL(java.lang.String url)
Description copied from class: Environment

Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource in the current application.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletResponse method encodeURL(url).

Portlet: This must be the value returned by the javax.portlet.PortletResponse method encodeURL(url).

Specified by:
encodeResourceURL in class Environment
Parameters:
url - The input URL to be encoded

redirect

public void redirect(java.lang.String url)
              throws java.io.IOException
Description copied from class: Environment

Redirect a request to the specified URL, and cause the responseComplete() method to be called on the FacesContext instance for the current request.

Servlet: This must be accomplished by calling the javax.servlet.http.HttpServletResponse method sendRedirect().

Portlet: This must be accomplished by calling the javax.portlet.ActionResponse method sendRedirect().

Specified by:
redirect in class Environment
Parameters:
url - Absolute URL to which the client should be redirected
Throws:
java.io.IOException - if an input/output error occurs

getRequestContextPath

public java.lang.String getRequestContextPath()
Description copied from class: Environment

Return the portion of the request URI that identifies the web application context for this request.

Servlet: This must be the value returned by the javax.servlet.http.HttpServletRequest method getContextPath().

Portlet: This must be the value returned by the javax.portlet.PortletRequest method getContextPath().

Specified by:
getRequestContextPath in class Environment

getRequestURI

public java.lang.String getRequestURI()
Specified by:
getRequestURI in class Environment

getRequestQueryString

public java.lang.String getRequestQueryString()
Overrides:
getRequestQueryString in class Environment

getRequestCharacterEncoding

public java.lang.String getRequestCharacterEncoding()
Specified by:
getRequestCharacterEncoding in class Environment

setRequestCharacterEncoding

public void setRequestCharacterEncoding(java.lang.String encoding)
                                 throws java.io.IOException
Specified by:
setRequestCharacterEncoding in class Environment
Throws:
java.io.IOException

getRequestParameterMap

public java.util.Map getRequestParameterMap()
Specified by:
getRequestParameterMap in class Environment

dispatch

public void dispatch(java.lang.String requestURI)
              throws java.io.IOException
Description copied from class: Environment

Dispatch a request to the specified resource to create output for this response.

Servlet: This must be accomplished by calling the javax.servlet.ServletContext method getRequestDispatcher(path), and calling the forward() method on the resulting object.

Portlet: This must be accomplished by calling the javax.portlet.PortletContext method getRequestDispatcher(), and calling the include() method on the resulting object.

Specified by:
dispatch in class Environment
Parameters:
requestURI - Context relative path to the specified resource, which must start with a slash ("/") character
Throws:
java.io.IOException - if an input/output error occurs

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 1 (11.1.1.7.0)

E10686-08

Copyright © 1997, 2013, Oracle. All rights reserved.