Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.portal.provider.v2.render.http
Class AbstractResourceRenderer

    java.lang.Object
      |
      +--oracle.portal.provider.v2.render.ManagedRenderer
            |
            +--oracle.portal.provider.v2.render.http.BaseManagedRenderer
                  |
                  +--oracle.portal.provider.v2.render.http.AbstractResourceRenderer

All Implemented Interfaces:
  InitializableXMLObject, Validateable

Direct Known Subclasses:
  ResourceRenderer, StrutsRenderer

public abstract class AbstractResourceRenderer
extends BaseManagedRenderer

This is the base class for renderers that use a request dispatcher to render content.

Constructor Summary
`AbstractResourceRenderer()` Null Constructor.

Method Summary
`java.lang.String` | `getCharSet()` Gets the character set to be used for rendering resource content.
`java.lang.String` | `getContext()` Gets the context root of the `javax.servlet.ServletContext` containing the resource.
`abstract java.lang.String` | `getRequestResourcePath(PortletRenderRequest prr)` Override this method to return a path to the resource to be rendered.
`boolean` | `prepareResponse(PortletRenderRequest pr)` In addition to setting default http headers for the response (see `BaseManagedRenderer`), this method ensures that the `HttpServletResponse` is wrapped in the correct manner.
`void` | `renderBody(PortletRenderRequest pr)` Render the specified page's contents from the required resource.
`void` | `setCharSet(java.lang.String charSet)` Sets the character set to be used for rendering resource content.

Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer
`addParameter, getContentType, getGeneratesESI, postInitialize, preInitialize, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching, validate`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractResourceRenderer

    public AbstractResourceRenderer()

  Null Constructor. The `BaseManagedRenderer.preInitialize(Object)` method should be called after creating an object with this constructor and the `BaseManagedRenderer.postInitialize()` method should be called after setting up page properties with the various accessor methods. Normally a `DefaultNodeHandler` takes care of these details.

Method Detail

### getContext

    public java.lang.String getContext()

  Gets the context root of the `javax.servlet.ServletContext` containing the resource. If the resource is located in the same context as the current provider, this method returns `null`.

  Returns:
    the context root, or `null` if the context is the same as the current provider.

### setCharSet

    public void setCharSet(java.lang.String charSet)

  Sets the character set to be used for rendering resource content. Overrides the default behaviour where the character set is defined in the content type request header or defaults to ISO-8859-1.

### getCharSet

    public java.lang.String getCharSet()

  Gets the character set to be used for rendering resource content.

### prepareResponse

    public boolean prepareResponse(PortletRenderRequest pr)
                            throws PortletException

  In addition to setting default http headers for the response (see `BaseManagedRenderer`), this method ensures that the `HttpServletResponse` is wrapped in the correct manner.

  Overrides:
    `prepareResponse` in class `BaseManagedRenderer`
  Parameters:
    `pr` - a `PortletRenderRequest`.
  Returns:
    boolean flag indicating whether or not to render the portlet's contents (e.g. is the cached version still valid)
    `PortletException`

### getRequestResourcePath

    public abstract java.lang.String getRequestResourcePath(PortletRenderRequest prr)
                                                     throws PortletException

  Override this method to return a path to the resource to be rendered.

    `PortletException`

### renderBody

    public void renderBody(PortletRenderRequest pr)
                    throws PortletException

  Render the specified page's contents from the required resource. This resource may be any that the servlet container can return a valid `javax.servlet.RequestDispatcher` for. Examples include JSPs, servlets and static HTML files.

  Specified by:
    `renderBody` in class `ManagedRenderer`
  Parameters:
    `pr` - a `PortletRenderRequest`.
    `PortletException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002,2003 Oracle Corporation. All Rights Reserved.