Sun Java System Portal Server 7.1 Developer Sample Guide

Using JavaServer Pages and (HTML) Template Files

To generate the rendered desktop user interface, the Portal Server software makes use of either JavaServer Pages (JSPTM) or template files. JSPs are preferred because they enable a much easier customization process without having to change the provider Java classes. JSPs also provide a way to enable a strict separation of business and presentation logic. Specifically, this means having the business logic in the provider classes and presentation logic in JSPs.


Note –

In general, a three-tier architecture consists of presentation logic, business logic, and the data. Tag libraries or Enterprise JavaBeansTM provide the business logic, a database contains the data, and JavaServer Pages (JSPs) or templates provide the presentation logic. However, this view is based on a “small” system where the entire system is contained in one server, or perhaps only the data is on another server.

The Portal Server software takes the “larger” system view, where all of the product is presentation. The business logic resides in some back end resource server that a content provider accesses. The data is on yet another back end server.


The default set of JSPs and template files are installed in PortalServer-DataDir/portals/portal-ID/desktop/default directory. The sample portal JSPs and template files are installed in PortalServer-DataDir/portals/portal-ID/desktop/developer_sample directory. The Desktop Type attribute in the Desktop attributes page of the Portal Server management console specifies from what subdirectory to retrieve either the JSP or template files for the Desktop.


Note –

How the JSPs and Template files are referenced by the providers is provider-specific. Some providers specify the file in the display profile, other providers specify fixed names.

For example, for JSPProvider, there are display profile properties such as contentPage, editPage, and so on, that reference Desktop files under the PortalServer-DataDir/portals/portal-ID/desktop/default directory. For other providers, such as BookmarkProvider, the name of the template file is fixed, for example, display.template and that name is mentioned in the display profile document for that provider.