Class PortletRequestDispatcherWrapper
- java.lang.Object
-
- jakarta.portlet.filter.PortletRequestDispatcherWrapper
-
- All Implemented Interfaces:
PortletRequestDispatcher
public class PortletRequestDispatcherWrapper extends Object implements PortletRequestDispatcher
ThePortletRequestDispatcherWrapperprovides a convenient implementation of thePortletRequestDispatcherinterface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected PortletRequestDispatcherwrapped
-
Constructor Summary
Constructors Constructor Description PortletRequestDispatcherWrapper(PortletRequestDispatcher wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforward(PortletRequest request, PortletResponse response)Forwards a portlet request from a portlet to another resource (servlet, JSP file, or HTML file) on the server.PortletRequestDispatchergetWrapped()Gets the wrapped object.voidinclude(PortletRequest request, PortletResponse response)Includes the content of a resource (servlet, JSP page, HTML file) in the response.voidinclude(RenderRequest request, RenderResponse response)Includes the content of a resource (servlet, JSP page, HTML file) in the response.voidsetWrapped(PortletRequestDispatcher wrapped)Sets the wrapped object.
-
-
-
Field Detail
-
wrapped
protected PortletRequestDispatcher wrapped
-
-
Constructor Detail
-
PortletRequestDispatcherWrapper
public PortletRequestDispatcherWrapper(PortletRequestDispatcher wrapped)
- Parameters:
wrapped- the wrapped dispatcher
-
-
Method Detail
-
getWrapped
public PortletRequestDispatcher getWrapped()
Gets the wrapped object.- Returns:
- the wrapped object.
-
setWrapped
public void setWrapped(PortletRequestDispatcher wrapped)
Sets the wrapped object.- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the request is null.
-
include
public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException
Description copied from interface:PortletRequestDispatcherIncludes 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:
includein interfacePortletRequestDispatcher- Parameters:
request- aRenderRequestobject that contains the client request. Must be either the render request passed to the portlet inrenderor a wrapped version of this render request.response- aRenderResponseobject that contains the render response. Must be either the render response passed to the portlet inrenderor 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.IOException- if the included resource throws this exception
-
include
public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException
Description copied from interface:PortletRequestDispatcherIncludes 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:
includein interfacePortletRequestDispatcher- Parameters:
request- aPortletRequestobject that contains the portlet request. Must be either the original request passed to the portlet or a wrapped version of this request.response- aPortletResponseobject 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.IOException- if the included resource throws this exception
-
forward
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException
Description copied from interface:PortletRequestDispatcherForwards 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
forwardmethod 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 anIllegalStateException. 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.
- Specified by:
forwardin interfacePortletRequestDispatcher- Parameters:
request- a request object that represents the request to the portletresponse- 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.IOException- if the included resource throws this exception
-
-