Show TOC Start of Content Area

Background documentation Including Requests  Locate the document in its SAP Library structure

Use

Use the include() method of the RequestDispatcher object to include the output of another servlet or JSP page in the response of the current servlet.

Process Flow

...

       1.      The servlet that uses the include() method passes the request to the other Web component.

       2.      The Web component processes the request and generates output.

       3.      This output is then returned to the initial servlet and included in the response.

The included Web component has access to the request object that is passes to the initial servlet. As far as the response object of the initial servlet is concerned, the included component can write to the response body but cannot commit the response. However, it is not allowed to change any header fields of the response.

Example

RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/SAPbanner");

    if (dispatcher != null)

        dispatcher.include(request, response);

 

 

 

End of Content Area