Editing JSF Pages
See Also
You can edit JSF pages using the IDE's source editor. From the Projects window,
you can double-click any JSF-related file node to open it in the editor.
Facelets Files
The IDE's editor provides the following support when editing Facelets pages.
- Code completion:
- JSF and Facelets tags: Press Ctrl-Space on JSF and
Facelets tags to invoke a pop-up listing valid tag entries for completing
a tag you've begun typing.
- JSF namespaces: If you apply code-completion for a
tag whose namespace is not yet declared in the file, the namespace
is automatically added to the page's <html> tag.
- JSF namespace paths: If you manually declare a
namespace, press Ctrl-Space between the quotes of a namespace
declaration to invoke a list of possible paths.
- EL (Expression Language) expressions: When typing EL
expressions in the editor, press Ctrl-Space to call up a list of possible
entries for completing the expression. The pop-up list typically includes
JSF managed beans and their properties, property bundle messages, and
implicit objects.
- Documentation: Press Ctrl-Space on JSF and Facelets
tags to invoke a documentation pop-up that describes the given tag.
- Hints and Error Messages: The editor provides you with
warning and error messages while you edit JSF pages. Errors display with
a red badge in the left margin of the editor, and the corresponding code
is underlined in red. You can hover your mouse over the badge or underlined
code to view a tooltip describing the cause of the error. The editor checks
whether:
- a declared library exists
- the library matched by the tag prefix contains such a component or tag
- the tag contains all required attributes
- all entered attributes are defined in the component's interface
- undeclared components exist on the page
- taglib declarations exist without usages
- Syntax highlighting:
- JSF and Facelets tags display in blue.
- Tag attributes display in green.
- Tag attribute values display in orange.
- EL expressions display in black, with light-green background.
Configuration Files
JSF 2.0 (JSR-314) does not require the Faces configuration file (faces-config.xml
),
however, if you add this file to your project, the following support is available.
Configuration Dialogs
Right-click menu support provides several dialogs that enable you to create entries
into the configuration file:
- Navigation Case dialog: Right-click in the editor and choose Insert > Navigation Case.
- Navigation Rule dialog: Right-click in the editor and choose Insert > Navigation Rule.
- Managed Bean dialog: Right-click in the editor and choose Insert > Managed Bean.
Hyperlinking
Hyperlinking is available in JSF configuration files, enabling you to quickly
navigate between a source and its reference. To make use of hyperlinking in
configuration files, hover the mouse over a JSF class entity while pressing
Ctrl. The class declaration displays as a hyperlink. Clicking on the link opens
the appropriate Java class in the Source Editor. In Facelets (and JSP) pages,
you can press Ctrl while hovering over managed beans, or accessor methods used
within JSF tags. Clicking the hyperlink that displays opens the respective
class or property in the Source Editor.
- See Also
- About JavaServer Faces Framework Support
- Creating a New Application with JSF Support
- Adding JavaServer Faces Framework Support to an Existing Application
- About Web Application Frameworks
Legal Notices