Show TOC Start of Content Area

Background documentation JSP as Standalone Resource  Locate the document in its SAP Library structure

To execute a JSP file within a component and include the output in the output of a component, specify the JSP page in the include() method of the portal request object.

The following shows how to include the output from a JSP page contained in the same application as the calling component:

public class CheckBoxComponent extends AbstractPortalComponent {

    public void doContent(

        IPortalComponentRequest request,

        IPortalComponentResponse response) {

 

        if (request!=null && response!=null) {

            IResource jspResource =

                request.getResource(IResource.JSP, "jsp/checkres.jsp");

            response.include(request, jspResource);

        }

 

}

Above, the JSP page checkres.jsp in the directory /PORTAL-INF/jsp is executed.

The following shows how to include a JSP page that is packaged in a different application:

        IResource jspResource =
           request.getResource(
              "JSPValidation",
IResource.JSP, "/jsp/include/checkres.jsp");

        response.include(request, jspResource);

Above, the JSP page checkres.jsp in the directory /PORTAL-INF/jsp/include of the application JSPValidation is executed.

 

End of Content Area