Show TOC Start of Content Area

Background documentation Servicing Render Requests  Locate the document in its SAP Library structure

The render() method of the Portlet object processes render requests. At render request processing time, portlets generate their content based on their current state. Similarly to the processAction() method, the render method receives two parameters: RenderRequest and RenderResponse. The RenderRequest object provides access to render parameters, the window state, the portlet mode, the portal context, the portlet context, and the portlet preferences data.

Example

While processing a render request, a portlet can delegate the content generation to a servlet or a JSP:

public void render (RenderRequest renderRequest, RenderResponse renderResponse)

    throws PortletException, java.io.IOException  {

     

      String path = “/page1.jsp”;

      PortletSession session = renderRequest.getPortletSession();

      PortletContext context = session.getPortletContext();

      PortletRequestDispatcher rd = context.getRequestDispatcher(path);

      rd.include(renderRequest, renderResponse);

     

  }

Note

Servlets and JSPs included from portlets should not use the servlet RequestDispatcher forward() method as its behavior may be non-deterministic.

 

 

End of Content Area