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: Interactive Form Portlet (FormExample)

Step 3: Create the Display Page

JSP pages are the presentation components of portlets. This is the source code for the FormExample portlet's JSP page, called FormExample.jsp.

This JSP page uses SAS custom tags, which are available with SAS AppDev Studio. For more information, see Creating the Presentation JSP Page.


<%-- Copyright (c) 2003 by SAS Institute Inc., Cary, NC 27513 --%>
<%@ page language="java"
import="com.sas.portal.portlet.PortletContext,
   com.sas.portal.portlet.PortletConstants"
contentType= "text/html; charset=UTF-8" %>

<%@taglib uri="http://www.sas.com/taglib/sas" prefix="sas"%>

<%--This portlet provides for echoing the user input back to the
   portlet display.  --%>

<% PortletContext context = (PortletContext)
   request.getAttribute(PortletConstants.CURRENT_PORTLET_CONTEXT );

%>

<sas:Form id="form" name="form" method="POST"
   action="<%= (String) context.getAttribute(\"formExample_baseURL\")%>">

<table border="0">
<tr>
   <td align="right">Please type something:</td>
   <td><sas:TextEntry id="userInput" /></td>
</tr>
<tr>
   <td> </td>
</tr>

<tr>
   <td align="right">You typed:</td>
   <td><%=(String) context.getAttribute("formExample_userInput") %></td>
</tr>

</table>

<sas:PushButton id="submit"
   text="Submit Form" type="submit" />

</sas:Form>