Creating a Web interaction to end a Web application

You can create a Web interaction that ends a Web application, and either does not require communication with a program, or invokes a cleanup procedure for the job on the iSeries host when an application ends. You can also create a web interaction that does not require a persistent iSeries job.

You can end a Web application in the following ways:
  • If you select Invalidate session after the interaction occurs (on the first page of the wizard), you are indicating that this interaction is the last in a series of interactions. Then if you select the No program call option on the third page of the wizard, you are indicating that a call to a host program is not required. When you select this option, any data that has been saved in the browser session is no longer available when this interaction ends. In addition, any data that was saved in the browser session cannot be displayed on the output page for this no program call interaction.

    Note: The No program call option is only available if you are defining an interaction that uses input and output pages that have already been created. If either Generate input JSP or Generate output JSP are selected on the second page of the wizard, Specify the Input and Output Pages for your Web Interaction, then this option is not available.

  • You can also select Invalidate session after the interaction occurs, and use the Use an iSeries program or procedure option to specify a procedure to clean up the iSeries job, and then use the interaction to invalidate the session.
  • If you select Terminate iSeries connection (on the first page of the wizard), you can create a web interaction that does not require a persistent iSeries job. This option means that the connection to the iSeries will be terminated after the interaction is complete. The next time the interaction occurs, it will automatically re-connect to the iSeries. There is no guarantee that the same job will be used. This option does not invalidate the session and has the advantage of freeing up the iSeries job for use elsewhere.
    Note: If the interaction uses subfiles you should not use this option because subfile data can only be retained using a persistent job.

For example, if you want to use a logout action to end the Web application, you could create an input JSP page with a logout button, and an output JSP page to confirm the logout action. When you start the Web Interaction wizard to create this no program call interaction, you select Invalidate session after the interaction occurs to indicate that this is the last interaction for the application. In the Web Interaction wizard, you specify the input and output JSP pages you want to use, select the no program call option, and create the Web interaction with the wizard. You do not do any mapping of JSP fields to program or service program parameters because no communication takes place between the pages and the program or service program on the iSeries host.

However, If you want to cleanup a job on the iSeries host, you select Invalidate session after the interaction occurs, but then select the Use an iSeries program or procedure radio button instead of the No program call radio button in the Web Interaction wizard. This lets you specify a procedure to be invoked when this last interaction occurs. When the procedure ends, the interaction invalidates the session and ends the iSeries job.