New JSF Pages from Entity Class Wizard: Entity Classes
See Also
This wizard generates JSP pages with JSF components based on entity classes in your web application.
The generated JSP pages provide a web interface for the entity classes.
The left column lists the entity classes in the module with data to be persisted.
For each entity class, the IDE creates four JSP pages enabling you to view, edit, create, and destroy entries in the data source.
The IDE also creates controller and converter classes for each entity class.
- To use JSF components in your web application, you must make sure that your project supports the JSF Framework.
You open the wizard by right-clicking a web application project node and choosing Other, selecting the Persistence category and then selecting JSF Pages from Entity Classes.
Use this page as follows:
- Select any entity classes from the available entity classes in the left panel and click Add.
When you click Add, the entity classes you select are listed in the right pane.
Any entity classes referenced by the entity classes you select are also listed in the right pane.
An entity class is greyed to indicate that it is referenced by another entity classes.
The IDE automatically generates JSP pages for each of the entity classes listed in the right pane.
- Include Referenced Classes. Deselect this if you do not want JSF pages created from referenced entity classes.
- Click Next to specify where to save the generated pages.
JSF managed beans are JavaBean components that are managed by a JSF implementation.
A JSF managed bean describes how a bean is created and managed.
The New JSF Managed Bean wizard creates a new JSF managed bean.
You open the New JSF Managed Bean wizard by right-clicking a web application,
choosing New > Other and selecting JSF Managed Bean from the Java Server Faces category.
In the Name and Location page, you have to set the following properties:
- Class Name. Specifies the JSF managed bean class name.
- Project. Specifies the project in which the JSF managed bean will be located.
- Location. Specifies a folder to house the JSF managed bean.
- Package. Specifies a package within the location to house the JSF managed bean.
- Created File. Specifies the file of the new JSF managed bean.
- Configuration File. Specifies the JSF configuration file. If none exists, you cannot create
a JSF managed bean. To create a JSF configuration file quickly and efficiently, right-click the project node, choose Properties
and use the Frameworks panel. Not only does this provide you with a JSF configuration file, but you also
get the JSF 1.1 libraries and a welcomeJSF.jsp file.
- Scope. Sets the scope of the JSF managed bean. Use the drop down list to set the scope to one of the following:
- request. Request scope contains data specific to an individual server request, and is discarded when the service method returns. This is the most common use of scope in web applications, and the IDE default to this setting.
- session. Session scope contains data specific to a user session.
- application. Application scope contains data for an entire web application.
- none. No scope is selected.
- Bean Description. Sets a description for the JSF managed bean.
- See Also
- About Web Application Frameworks
- Creating a New Application with JSF Support
- Adding JSF Support to an Existing Application
Legal Notices