Extending a web project with Java Server Faces (JSF) includes
copying of JSF JAR files and configuration files, changing deployment
descriptor and set up the JSF to ready for development.
There are two ways how to add the JSF into a web projects:
During creation of a new Web Application. The user is able to add
JSF support neither during creating new Web Application with
Existing Sources nor creating new Web Application with existing Ant
Script.
When a web project already exist.
Scenario 1 - Creating new Web Application with JSF support:
The panel for the customizer is almost the same as the panel
for new Web Application Wizard.
Figure: Panel, which is displayed in the Project Customizer.
Configuration File - JSF configuration file, where the new ManagedBean
will be defined. This listbox contains all JSF configuration files in the working project.
Scope - not editable combobox where are these values:
request (default)
session
application
none
Bean Description - text area
Next - disabled
Finish - default value
Error Conditions:
Configuration File - must be selected
Class Name and Location - part of standard Java class wizard
with its error conditions
The Dialog is accessible through the context menu in editor for JSF
configuration file. Includes new definition of navigation-case element. When
the dialog is invoke, when the cursor is inside a navigation rule, then the
navigation rule is used as default.
Figure: Shows dialog for entering new Navigation Case.
From View - this is editable combobox. The values are taken
from the configuration files (the value of from-view-id in navigation-rule). When
the dialog is invoke, when the cursor is inside a navigation rule, then the
default value is the value of from-view element of this navigation rule.
The Browse... button opens an file browse dialog, where
the Web Pages folder is the root. If there is no navigation rule for such file,
then new navigation rule is created as well.
To View - this is editable combobox. The values are taken
from the configuration files (the value of from-view-id in navigation-rule).
The Browse... button opens an file browse dialog, where
the Web Pages folder is the root.
When user edits a jsp file and uses JSF tags, it's very useful to
provide hyperlink for faster navigation between the jsp files and
appropriate JSF files, application resources etc.
The contextual menu is taken from the XML Editor, but the dialogs
for adding elements should be accessible through this menu and there
should be action for validation of the file.
Contextual Menu:
JSF >
Select in >
Cut CTRL-X
Copy CTRL-C
Paste CTRL-V
Reformat Code CTRL-SHIF-F
Check XML ALT-F9
Validate XML ALT-SHIFT-F9
Tools
Contextual JSF SubMenu:
Add Managed Bean
Add Navigation Rule
Add Navigation Case