Save and restore data

You can save input data in the browser session and retrieve it from the browser session for use in interactions in your Web application. Saving and restoring data in this way eliminates the need to communicate with a program or Java bean method to retrieve the data when it is required in an interaction.

For example, assume that you are using an application that updates information for an existing customer. You start by entering a customer number on an input page and clicking Submit. The information displayed on an output page includes the customer number you entered as well as the customer name, address, and contact information. The customer number that is on this output page can be restored from the browser session rather than be returned from the program or Java bean.

You specify the save and restore options for the data in the Web Interaction wizard. The options are available in the Property areas on the following wizard pages:

When you choose to save data to the browser session, you can specify a name to associate with that data. The default is the name of the parameter or field. You enter the name in the Value field for the property Name in Session.

To save the data associated with an input or output parameter or field, select true in the list in the Value field for the Save to Session and Restore from Session properties.

You can specify the scope of an input Action Form bean generated by the Web Interaction wizard, to session scope or request scope. The default scope is request. All the data that you entered in an input form is saved in the input Action Form bean. If you set the scope of the Action Form bean to session, you can retrieve the input data from the session. You can change the scope of an Action Form bean for an input page as follows:
  • If the input page is generated by the Web Interaction wizard, you can change the value of the Form Bean Scope property on the Design the Input Form page of the wizard.
    The Form Bean Scope property selection that appears on the Design the Input Form page of the wizard.
  • If the input page already exists, then on the Map and Link the Input Parameters to the Input Fields page in the wizard, select the FORM element in the tree under Input page fields, and then change the value of the Form Bean Scope property.
    The Form Bean Scope property selection that appears on the Map and Link the Input Parameters to the Input Fields page of the wizard.