Creating JPA-enabled web projects

JPA-enabled web projects hold all of the web resources used by your web application to access or modify data in a database.

Procedure

  1. In the Enterprise Explorer view, right-click and select New > Web Project.
  2. In the Name field, enter a name for your new web project.
  3. From the list of project templates, click one of the following templates to use as a starting point to create your JPA-enabled web project:
    • Dojo Toolkit
    • Java Server Faces
    • REST Services
    • Simple
  4. In the Programming Model section, specify one of the following programming models to use when creating your project:
    • To use Java EE technologies such as Servlets, JSPs, or JPA to develop your web application, click Java EE.
    • To use Java EE technologies such as Servlets and JPA within the OSGi programming model, click OSGi.
  5. Click Next and from the list of available configuration options, click Deployment.
  6. From the Target Runtime list, select the run time to use at build time to compile your new web project.
    Note: If the target run time was previously set, this list is not available. Complete one of the following steps to make this list available:
    • Specify a new EAR project name and then select a target run time.
    • Select an existing EAR project from the list that uses the target run time that you want to use.
  7. Add the JPA (Java Persistence API) feature to your web project:
    1. Click Change Features.
    2. Select JPA and click OK. The JPA configuration is added to the list of available configuration options.
      Tip: If you want to include user interfaces on your web pages, select the following JSF features:
      • JavaServer Faces
      • JSTL
      For more information about JSF features, see JSF Facets.
  8. From the list of available configuration options, click JPA.
  9. Create a connection profile that contains the connection property information required to connect to a data source in your enterprise:
    1. Click Add connection.
    2. From the list of Connection Profile Types, select your connection profile type and click Next.
    3. Complete the information required by the wizard to create a connection profile.
    4. Click Finish to return to the New Web Project wizard.
  10. Click Finish to create your web project.

Feedback