Creating a JSP file to display the worklist

The first step of creating a group worklist was to create a custom viewer. This section describes the second step, in which you create a JSP file to display the group worklist. When you create the JSP file, the worklist page that is generated by the base class DefaultViewer is replaced with a page generated by a custom JSP file.

The source files for setting up a group worklist are stored in the <MQWFDir>/smp/WebClient/groupwl directory. To create the JSP file:

  1. Change to the step2 directory.
  2. Copy the GroupWorkListViewer.start file to GroupWorkListViewer.java.
  3. Edit the GroupWorkListViewer.java file, and change the base class from DefaultViewer to JSPViewer. This step provides JSP-based implementations for all of the methods that are not overridden by the GroupWorkListViewer class.
  4. Replace the call to the base class' queryWorkItemsResponse method with a call to your own class.
  5. Add the queryWorkItemsResponse method. The first statement in this method is used to store the workListOID that is passed to the JSP in the RequestContext object. This Object Identifier (OID) is set in logonResponse.
  6. Create and return a ResponsePage object that forwards creating the response page to the /forms/GroupWorkList.jsp file.
  7. Copy GroupWorkList.start to GroupWorkList.jsp.
  8. Edit the GroupWorkList.jsp file and add the import statement for the package of the Web client.
  9. Add a jsp:useBean statement to access the RequestContext object that is necessary to create the response page. This is the same object, which was passed as a parameter to the ResponsePage in the queryWorkItemsResponse method. Use the following attributes for the useBean statement:
    id="context"
    scope="request"
    type="com.ibm.workflow.servlet.client.RequestContext"
    
  10. Retrieve the workListOID that has been set in the queryWorkItemsResponse method. Use the RequestContext.getAttribute() call for this.
  11. Create a string cmdRefresh for the queryWorkItems command used by the 'Refresh' button. Set the useCache parameter to false. The SessionContext class provides methods to create these command strings.
  12. Check the loop that constructs a line for each work item on the worklist.
  13. To deploy the JSP, copy the file GroupWorkList.jsp to the <MQWFDir>/cfgs/<cfgID>/WebClient/webpages/forms directory.
  14. Change to the parent directory and run
    jc step2\GroupWorkListViewer.java
    to compile your file.
  15. Restart your Web server and logon to MQ Workflow using the http://localhost/MQWFClient-<cfgID>/RTC.html page.
  16. Compare your solution with the provided solution (file names: GroupWorkListViewer.sol and GroupWorkList.sol).

Go to Step 3: Creating a CommandHandler that provides a queryGroupWorkItems command