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 portlet or be wrapped versions of these.
@param request a request object that represents the request to the portlet
@param response a reponse object that contains the portlet response
@exception PortletException if the included resource throws a ServletException, or other exceptions that are not Runtime- or IOExceptions.
@exception java.io.IOException if the included resource throws this exception
@exception java.lang.IllegalStateException if the response was already committed
@since 2.0