Sun Java System Portal Server 7.1 Developer's Guide

JSPProvider

A JSPProvider is a content provider that can use JSP to create the content for a channel on the Desktop.

The step-by-step process of the JSPProvider invoking a JSP is:

  1. The JSPProvider.getContent() method is called and the JSPProvider looks up the JSP to be executed. It calls a common private method to service the JSP.

  2. The provider then creates request and response objects, copies information (such as cookies) from the Desktop request to those objects, initializes the session information, and checks to see if a servlet wrapper for the JSP already exists. If not, a servlet wrapper is created. The service method is then called on the wrapper.

  3. The servlet wrapper service method loads the JSP. Before loading, it checks to see if the JSP class file is out of date with the class file. If the JSP class file is out of date with the class file, it invokes the compiler to compile the JSP into a class file and read the class file into memory and uses the class loader to define the new class.

  4. Finally, the JSP servlet is instantiated and the init() method is called on the JSP.

  5. Once the JSP is loaded, the JSP’s service method is called by the servlet wrapper service method.

  6. After the JSP’s service method completes, the JSPProvider getContent() method extracts the response body from the processed JSP file and returns it as a StringBuffer.