Running Persistence Sample Web Application

The Persistence sample demonstrates the persistence of user entered information when a session on a card is resumed. The sample stores user-entered information as history and, when the card resumes functioning, the previous entries are made available.

Running the Persistence sample consists of using the IDE to open the Persistence project, starting the application, clicking the hyperlink on the Persistence web page to open the database form, using the form to add and delete items in the database list, and stopping and restarting the server. When the server is stopped and restarted the items in the list should not change.

Before You Begin

Before performing the following procedure, the Java Card 3 Development Kit, Connected Editon must be downloaded and installed on your development system.

The Persistence project is located under the JC_CONNECTED_HOME\samples\web folder.


Note - Refer to the Java Card 3 Platform Development Kit User’s Guide for additional details including screen captures.


  1. Click File > Open Project in the main window.
  2. Go to the JC_CONNECTED_HOME\samples\web folder and open the Persistence project.
  3. Click the run button in the main window.

    The IDE compiles, builds, and runs the sample. When the sample runs the IDE launches the default browser and displays the Persistence page.

  4. Click the Database hyperlink.
  5. Enter text in the Item field and click the Add button.

    The browser displays the added text in the Items in Database list.

  6. Delete an item from the list.
    1. Type the name of an item in the Item text field.
    2. Click the Delete button.
  7. Stop and resume the server.
    1. Go to the Default Device in the Services window and right click on it to display the Default Device menu.
    2. Click the Stop menu item to stop the server.

      The browser is no longer connected to the device.

    3. Right click on the Default Device to display the menu.
    4. Click the Resume menu item to start the server.

      Note - Clicking the Restart menu item terminates this server instance and starts a new server instance. The data is not persistent from one server instance to another.


      Verify that the content in the database list is unchanged.

  8. Add a new item to the list to verify that the database is still functional.
  9. Close the browser to stop the application.