< Previous | Next >

Lesson 1.7: Run the Web application to test the entities

In this lesson you will learn how to run the Web application on the server.
Before you begin, you must complete the lesson Lesson 1.6: Create JPA manager beans.
Note: If your runtime target is WebSphere Application Server, Version 7.0, then there will be errors in the Problems view regarding annotations not being recognized. For example, The annotation PersistenceUnit will not be recognized by WebSphere Application Server v7.0 runtimes. Set the UseEJB61FEPScanPolicy custom property to true in the MANIFEST.MF file for this module. You must correct these problems before you can run the Web project on the server.
To fix the problems, do the following steps:
  • In the Problems view, right-click one of the errors and select Quick Fix.
  • In the Quick Fix window, ensure that you select the fix Set the UseEJB61FEPScanPolicy custom property to true in the MANIFEST.MF file for this module and then click Finish. The error messages disappear.

To run the Web project on the server:

  1. In the Enterprise Explorer view, expand JPATutorial > Webcontent.
  2. Right-click the index.jsp file, and click Run As > Run on Server.
    Screen shot showing the index.jsp file in the Packages Explorer view.
  3. A Web browser opens and displays the Employee List application.
The Employee List application demonstrates the use of Java™ Persistent API (JPA) to access employee data. The application maps persistent entities to columns in a database table and presents the information on a Web site, where users can create, read, update, and delete data.
Screen shot showing the Employee List application working in a browser.

Lesson checkpoint

Congratulations! You have completed this tutorial.
< Previous | Next >

Feedback