Exercise 8.2: Modifying your Web interaction

Before you begin, you must complete Exercise 8.1: Creating the flow control page.

Now you need to change the Web interaction to use the new error page.

To modify the Web interaction:

  1. Expand your project WSSLABxx if not already expanded.
  2. Right-click custInquiry.wit and click Open With > iSeries Web Interaction Wizard on the pop-up menu.
    Open with iSeries Web Interaction Wizard

    The Web Interaction wizard opens.

    The name and location of your Web interaction are already specified.

  3. Click Next to add a new output page.
    Specify input/output JSP's
  4. Next to the result.jsp section, click Add.

    The Output JSP window opens.
    Output JSP

  5. Select RecordNotFound.jsp.
  6. Click OK to add the new output page.
    Adding RecordNotFound.jsp as one of the output pages
  7. Click Next in the Web Interaction wizard.

    You will re-use the Feedback parameter to control which page the Web Interaction will send next after it performs its action; the result.jsp or the RecordNotFound.jsp. So you don't have to add another parameter or change the parameters, you just change the values the feedback parameter returns depending on whether a customer record was found or not found.

  8. Click Next since you don't need to define the program interface.

    This opens the Input Parameters page.

  9. Click Next again since you don't need to change any input parameters.

    This opens the Output Parameters page.
    Output parameters page

  10. Select FEEDBACK under the Output Parameters list.
  11. Change the Message Controller property to false. Click OK.
  12. Select feedback under the Output Parameters list again.

    Now a Flow controller property is added to the Properties table.
    Flow Controller added to the Property Table

  13. Change the Flow Controller property to true.

    The Flow Control Specification dialog opens.
    Flow Control Specification

  14. The value *OTHER is already in the Value field for the /error.jsp.
  15. Click the /error.jsp field to change the Output JSP page.
  16. Select RecordNotFound.jsp from the list.
  17. Click New.

    This creates a new flow condition. The default page is result.jsp.

  18. The value 0 is already in the Value field with result.jsp in the Output JSP field.
  19. Click OK.

    This will set the flow control such that if the value of Feedback is 0, then the program will output the customer information to the result.jsp page and display it.

    However, if the customer number doesn't exist in the database, the Feedback value will be something else other than 0, and instead of displaying a message near the input field, it will show the user the RecordNotFound.jsp page for a more helpful response.

  20. Click Finish on the Output Parameters page to apply your changes to the Web Interaction.
    Click Finish to apply the changes

You have changed the Web interaction to use the new error page and now you are ready to begin Exercise 8.3: Testing the new error page.