This section describes how to populate the response pages with the required fields, and how to maintain session identity.
The HTML page rendered by a JSP can contain simple data fields or complex data, such as indexed collections. Simple data fields (at whatever level of nested keyed collections inside the context hierarchy) must be defined in the following way:
nested_path.DataName
The indexed collection data must be defined in the following way:
nested_path.IndexedCollection_Name.Index.DataName
Other than application fields, there are some mandatory hidden fields that need to be present in the portlet request. These fields must be returned to the client in the previous portlet response from the server. See Mandatory hidden form fields.
Use JSP code to create the hidden fields required by the toolkit. See the following code for example. In the sample code, utb is a bean instance of the com.ibm.btt.portal.base.PortletJspContextServices class.
<%= utb.getRequiredHtmlFields() %>
The com.ibm.btt.portal.base.PortletJspContextServices bean automatically creates those hidden fields. The following is an example of JSP code for initializing the bean:
<jsp:useBean id="utb" scope="page" class=" com.ibm.btt.portal.base.PortletJspContextServices"> <% utb.initialize ( request ); %> </jsp:useBean>
The toolkit provides the com.ibm.btt.portal.base.PortletJspContextServices class to access the context, as an implementation of the JspContextServices interface. JSP code might use this class to get access to the information available in the context hierarchy, which it requires to send the appropriate fields to the client. JSP tags use this class for rendering the proper HTML output.
For detailed information about writing JSPs, see ../../../../com.ibm.btt.application_presentation.doc_6.1.2/doc/tasks/portletJSP/creatingjsp.html.