|
||
Table of Contents |
||
1. Introduction
This document presents an overview of JSF features available in
MyEclipse 6.0.
|
||
2. Adding JSF Support to Web ProjectsIn order to create a JSF project, first it requires an existing MyEclipse Web Project. Then JSF Project capabilities can be added to that project to give it JSF support. The JSF Support includes configured web.xml, generated faces-config.xml, and all necessary JSF runtime libraries. For more overview information visit the following topics: |
||
2.1 JSF Capabilities Wizard
JSF Project support can be added to an existing MyEclipse Web
Project by using the "Add JSF Capabilities..." menu
entry in the MyEclipse menu. This menu item starts the
"Add JSF Capabilities" wizard.
The JSF Capabilities wizard allows selection of the JSF implementation, and config path, servlet name and URL pattern. Optional support for Facelets can also be added.
Once the JSF Capabilities wizard completes, the Web Project will
be configured with JSF runtime libraries, web.xml will be
configured with necessary configuration, and a new
faces-config.xml file will have been added to the project as
shown in Figure 2.1.3.
|
||
2.2 JSF Runtime Libraries
MyEclipse comes bundled with multiple JSF implementations that
are configurable through the Project Capabilities preference
page. For each JSF Library module, the list of jars
associated with the library module can be modified. Other
options related to add JSF capabilities to a project can also be
configured.
|
||
3. Visual JSF Designer |
||
4. Visual Faces-Config Editor
MyEclipse has an advanced visual Faces Config editor that is the
default editor for faces-config.xml files. So simply
double-clicking the file will open the MyEclipse JSF Config
Editor.
There are 3 different features of the JSF Config Editor that are
covered in the following sections.
|
||
4.1 Design Page
The JSF Config editor opens by default in the design page.
This shows a visual representation of your
faces-config.xml. Each element can be selected and modified
by dragging-and-dropping around the design palette.
For an selected element, either navigation node or connection,
the context-menu will bring up actions that allow editing the
element or adding additional navigation rules.
New navigation nodes can be added to the design page by selecting
the navigation node element in the palette and then
dragging-and-dropping onto the design view.
New navigation cases can be added by selecting the Navigate case
tool and then drawing a new connection between two existing
navigation nodes as shown in Figure 4.1.4.
The design page of the Visual JSF Config Editor contributes
several toolbar actions to the eclipse toolbar that are used for
the currently open design page.
|
||
4.2 Source PageThe source page of the JSF Config Editor is based on the MyEclipse XML Editor but has some additional features that are shown in this section. One additional feature is code-assist for class names for the managed-bean-class element as shown in Figure 4.2.1.
Because the JSF Config Editor is based on the MyEclipse XML Editor, it also picks up code-assist, documentation, and validation for all faces-config elements. Code-assist for JSF 1.2 schema is shown in Figure 4.2.2.
Validation for faces-config XML elements is also available in the
JSF Config Editor as shown in Figure 4.2.3.
|
||
4.3 JSF Config-Editor Outline PageAlong with the Source and Design pages, the JSF Config Editor has an advanced outline page that is associated with the editor. The view menu of the outline page contains some additional actions including 3 modes of operation and 10 new JSF wizards.
All elements in the outline view can be edited with a JSF wizard by selecting the "edit" action from the context-menu of the node.
Below is the JSF managed bean wizard that is opened when the
"edit" action in the previous figure is selected.
|
||
5. JSF Wizards
MyEclipse provides basic and advanced wizards for all of the JSF
config elements. These wizards can be invoked from the
outline view of JSF Config Editor and also from the File > New
> Other... > MyEclipse > Web-JSF category as shown in
Figure 5.1.
|
||
5.1 JSF Elements wizardsNew Managed Bean wizard allows configuration of Name, scope and properties. Code-assist is available for existing Java classes that are going to be declared as managed beans. This wizard can also create new managed beans by specifying a new class name and then selecting the "Generate Java code". Also if an existing class is being specified, additional properties on the Java class can be added by using the "Generate missing getters/setters for properties" option.
New Navigation rule wizard can be opened from File > New, menu and you have to specify the project and config file. If you start this wizard from the outline view, the first 3 fields will already be selected.
New validator wizard.
New Converter Wizard.
New Referenced Bean Wizard
New Application Wizard.
New Component Wizard
New RenderKit Wizard
New JSF XML Config File Wizard
New Factory Wizard
New Lifecycle Wizard
|
||
5.2 New JSF Page Wizard
New JSF pages that use JSP can be created by using the JSP
(Advanced templates) wizard and then selecting the "Default
JSF Template".
On page 2 of the new JSP Page wizard, in the "template to use" field select the "Default JSF Template" option.
|
||
6. Facelets Support
For existing JSF Projects, add Facelets support by using
"Add JSF Facelets capabilities..." wizard.
|
||
6.1 Facelets XHTML Page Wizard
|
||
6.2 Facelets Support in JSF Designer
|
||
6.3 Code-Assist/Validation available for
Facelets
|
||
7. FeedbackWe would like to hear from you! If you liked this overview, have some suggestions or even some corrections for us please let us know. We track all user feedback about our learning material in our Documentation Forum. Please be sure to let us know which piece of MyEclipse material you are commenting on so we can quickly pinpoint any issues that arise. |