Generating JSF Pages from an Entity Class

See Also

An entity class is a class that uses the Java Persistence API to access a data source. In a web application project, you can use the JSF Pages from Entity Classes wizard to generate a series of JSP pages that use the JSF framework and the entity classes to access entries in the database and provide CRUD functionality (Create, Read, Update, Delete). The JSP pages use JSF components.

To generate JSF pages from an entity class:

  1. Choose File > New (Ctrl-N) from the main menu.
  2. From the Persistence category, select JSF Pages from Entity Class and click Next. The wizard displays all of the entity classes in the project.
  3. Add all of the entity classes for which you want to generate JSF pages to the Selected Entity Classes list and click Next.
  4. Specify a package for the JPA controller and JSF classes. The default location is the folder containing the selected entity classes.
  5. (Optional) Specify a folder in which to place the JSF pages.
  6. Select Ajax-enabled generated pages if you want the IDE to add the necessary libraries and JavaScript files to enable the use of Ajax requests.
  7. Click Finish.

When you click Finish the IDE generates the following artifacts for each entity class.

The IDE also creates the following:

See Also
About Web Application Frameworks
Adding JSF Support to an Existing Application
Generating JPA Controller Classes from an Entity Class
About CRUD Applications
Creating an Entity Class
Generating Persistent Entity Classes from a Database

Legal Notices