SAS 9.1.3 Integration Technologies » SAS Web Infrastructure Kit: Developer's Guide


Developing Custom Portlets
Development Steps
Creating a Deployment Descriptor
Creating Display Resources Files
Developing the Presentation JSP Page
Creating Action Classes
Implementing Portlet Help
Creating a PAR File
Use Cases
Simple Display Portlet
Localized Portlet
Portlet Template (Editable Portlet)
Remote Portlet
Tips and Best Practices
Using the Portlet API
Sample Portlets
Localized Display Portlet (Welcome)
Interactive Form Portlet (FormExample)
Portlet Template, or Editable Portlet (DisplayURL)
Web Application (HelloUserWikExample)
Remote Portlet (HelloUserRemote
Portlet
Sample: Localized Display Portlet (Welcome Portlet)

Step 3: Create the Display Page

JSP pages are the presentation components of portlets. This is the source code for the Welcome portlet's JSP page, called Welcome.jsp. The boxes contain explanatory comments. For more information, see Creating the Presentation JSP Page.


<%-- Copyright (c) 2001 by SAS Institute Inc., Cary, NC 27513 --%>
The following line contains the UTF-8 directive, which is required for internationalization. This directive causes all user input to be encoded in the 8-bit Unicode Transformation Format, which supports all of the world's languages including those that use non-Latin1 characters.
<%@ page language="java" contentType= "text/html; charset=UTF-8" %>	

The following line contains the taglib directive for the JSP Standard Tag Library (JSTL) formatting tags. The directive must appear before the first use of these tags.

<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%--This portlet provides the welcome greeting on the Public Kiosk.  --%>

The following lines use JSTL formatting tags to display text. The key attribute is used to obtain the appropriate text from the resource bundle that most closely matches the user's locale preference. The SAS Web Infrastructure Kit makes the user's locale available to these tags.

<fmt:message key="welcome.msg1.txt"/>
<br>
<fmt:message key="welcome.msg2.txt"/>