org.apache.pluto.internal.impl
Class PortletRequestDispatcherImpl

java.lang.Object
  extended by org.apache.pluto.internal.impl.PortletRequestDispatcherImpl
All Implemented Interfaces:
PortletRequestDispatcher

public class PortletRequestDispatcherImpl
extends java.lang.Object
implements PortletRequestDispatcher

Implementation of the PortletRequestDispatcher interface. The portlet request dispatcher is used to dispatch RenderRequest and RenderResponse to a URI. Note that ActionRequest and ActionResponse can never be dispatched.


Constructor Summary
PortletRequestDispatcherImpl(javax.servlet.RequestDispatcher requestDispatcher)
          Creates an instance.
PortletRequestDispatcherImpl(javax.servlet.RequestDispatcher requestDispatcher, java.lang.String path)
          Creates an instance.
 
Method Summary
 void forward(PortletRequest request, PortletResponse response)
          Forwards a portlet request from a portlet to another resource (servlet, JSP file, or HTML file) on the server.
 void include(PortletRequest request, PortletResponse response)
          Includes the content of a resource (servlet, JSP page, HTML file) in the response.
 void include(RenderRequest request, RenderResponse response)
          Includes the content of a resource (servlet, JSP page, HTML file) in the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletRequestDispatcherImpl

public PortletRequestDispatcherImpl(javax.servlet.RequestDispatcher requestDispatcher)
Creates an instance. This constructor should be called to construct a named dispatcher.

Parameters:
requestDispatcher - the servlet request dispatcher.
See Also:
PortletContext.getNamedDispatcher(String)

PortletRequestDispatcherImpl

public PortletRequestDispatcherImpl(javax.servlet.RequestDispatcher requestDispatcher,
                                    java.lang.String path)
Creates an instance. This constructor should be called to construct a portlet request dispatcher.

Parameters:
requestDispatcher - the servlet request dispatcher.
queryString - the included query string.
See Also:
PortletContext.getRequestDispatcher(String)
Method Detail

include

public void include(PortletRequest request,
                    PortletResponse response)
             throws PortletException,
                    java.io.IOException
Description copied from interface: PortletRequestDispatcher
Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

The included servlet cannot set or change the response status code or set headers; any attempt to make a change is ignored.

Specified by:
include in interface PortletRequestDispatcher
Parameters:
request - a PortletRequest object that contains the portlet request. Must be either the original request passed to the portlet or a wrapped version of this request.
response - a PortletResponse object that contains the portlet response. Must be either the portlet response passed to the portlet or a wrapped version of this response.
Throws:
PortletException - if the included resource throws a ServletException, or other exceptions that are not Runtime- or IOExceptions.
java.io.IOException - if the included resource throws this exception

include

public void include(RenderRequest request,
                    RenderResponse response)
             throws PortletException,
                    java.io.IOException
Description copied from interface: PortletRequestDispatcher
Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

The included servlet cannot set or change the response status code or set headers; any attempt to make a change is ignored.

This method is kept in order to provide backward compatibility with version 1.0. Please use PortletRequestDispatcher.include(PortletRequest, PortletResponse) instead of this method.

Specified by:
include in interface PortletRequestDispatcher
Parameters:
request - a RenderRequest object that contains the client request. Must be either the render request passed to the portlet in render or a wrapped version of this render request.
response - a RenderResponse object that contains the render response. Must be either the render response passed to the portlet in render or a wrapped version of this render response.
Throws:
PortletException - if the included resource throws a ServletException, or other exceptions that are not Runtime- or IOExceptions.
java.io.IOException - if the included resource throws this exception

forward

public void forward(PortletRequest request,
                    PortletResponse response)
             throws PortletException,
                    java.io.IOException,
                    java.lang.IllegalStateException
Description copied from interface: PortletRequestDispatcher
Forwards a portlet request from a portlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows the portlet to do preliminary processing of a request and another resource to generate the response.

The forward method should be called before the response has been committed to the portlet container (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.

The request and response parameters must be either the same objects as were passed to the calling portletor be wrapped versions of these.

Specified by:
forward in interface PortletRequestDispatcher
Parameters:
request - a request object that represents the request to the portlet
response - a reponse object that contains the portlet response
Throws:
PortletException - if the included resource throws a ServletException, or other exceptions that are not Runtime- or IOExceptions.
java.io.IOException - if the included resource throws this exception
java.lang.IllegalStateException - if the response was already committed


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.