Class Name : org.apache.jetspeed.portal.portlets.JspPortlet


Present the output of a JSP in a portlet.

Why use a JSP portlet instead of a WebPagePortlet?

  • JSP does not have to be visible to the Web Server
  • Specific task can not be achieved with WebPagePortlet

Jetspeed Tag Library

The JSP can display information from Jetspeed by using Jetspeed's Tag Library. The type of information ranges from username to Link information. <jetspeed_home>/WEB-INF/templates/jsp/tld/template.tld contains the TagLib declarations.

To use Jetspeed TagLibs, the following must appear in the JSP.

<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>

The following table documents some of the available tags. The template.tdl file will contain a more complete list.

Tag NameDescription
jetspeed:info Return value of requestInfo

EmailE-Mail address of the logged in user
FirstNameFirst name of the logged in user
LastNameLast name of the logged in user
UsernameUsername of the logged in user
ServerDateCurrent Data and Time on the server
jetspeed:uriLookup Return value of uriLookup

CustomizeLink to the Customizer
EditAccountLink to edit the current user's account
LoginLink to login a user
LogoutLink to logout the current user
HomeLink to this Jetspeed installation's Home Page
jetspeed:contentUri Return value of contentUri

apidocsLink to the Jetspeeds JavaDocs
docsLink to the Jetspeed Documentation
rssLink to RSS files

Supported Media Types

Description of Media Types.

Element: parameter

Parameter that control the how the web page is converted into a portlet.

This template parameter is required.

Parameters common to many portlets.

Parameter NameDescription
template Name of JSP file. The actual file will be located by using the current media type, language, and country in the directory <jetspeed_home>/WEB-INF/templates/jsp/portlets

Example of Registry Entry

<portlet-entry name="HelloJSP" hidden="false" type="ref"
    parent="JSP" application="false">
        <description>Simple JSP Portlet Example</description>
    <parameter name="template"
        value="hello.jsp" hidden="false"/>
    <media-type ref="html"/>

Example of Portlets

Jetspeed include the following example of JSP porlets.

Portlet NameDescription
HelloJSPBasic JSP portlet
JSP1_1andJetspeedTagLib Displays data from the servlet 1.1 request class and data from the Jetspeed TagLib.
JSP1_2andJetspeedTagLib Displays data from the servlet 1.2 request class and data from the Jetspeed TagLib. This portlet will NOT work with Tomcat v3.x, or any other Servlet 1.1 container.