Editing a Faces configuration file

The Faces configuration file lists the bean resources, validators, navigation rules, and other elements for a JSF application. Metadata settings in the faces-config file override any annotations in your application.

Procedure

  1. In the Enterprise Explorer view, expand your web project.
  2. Click WebContent > WEB-INF.
  3. Double-click the configuration file to open the Faces configuration file in the editor.
  4. Make any necessary changes to your configuration file by selecting a node in the tree and adding, editing, or removing items. Some elements have additional settings in the Details section on the right side of the editor. You can add the following elements:
  5. Once you have configured your application, save the file.

What to do next

When you have finished editing the file, save and close the file.

Faces Config

In the Overview section, filter the tree by typing in the field above the tree. You can also sort the tree alphabetically, and expand or collapse all elements in the tree.

In the Details section, enter the name of the Faces configuration file. A name is useful if you have more than one Faces configuration file and if you are using ordering or absolute ordering to determine which configuration file to load first.

Click the Ignore Faces configuration annotations check box to disable annotation scanning.

Absolute Ordering (JSF 2.0 only)

Use the absolute ordering element to specify the absolute order in which the named JSF configuration files are loaded.

Name
Name of the configuration file. The order of the name elements appear in the absolute ordering list determines the order in which the configuration files are loaded.
Others
Specifies that additional configuration files that are not specified with the name element can be loaded according to their relative ordering in the ordering element.

Application

The application element defines settings for the application. Click Add to add subelements.

Action listener
Specify the fully qualified class name of the ActionListener implementation class that is called during the invoke application phase of the request processing life cycle.
Default RenderKit
In the RenderKit id field, specify a render kit for the application to use instead of the default render kit.
Default Validators (JSF 2.0 only)
In the Validator ids list, specify a list of validators to attach to the editable value holders in the application.
EL Resolver
Specify the fully qualified class name of the ELResolver implementation class that is used to process EL expressions. EL expressions are used to access application data from a bean using simple syntax such as #{person.name}.
Locale Config
Define the locales that are supported for this application.
Message Bundle
In the Base name field, specify the fully qualified base name of a resource bundle that contains the message resources for this application.
Navigation Handler
Specify the fully qualified class name of the NavigationHandler implementation class that is called during the invoke application phase of the request processing lifecycle.
Property Resolver
Specify the fully qualified class name of the PropertyResolver implementation class that is used to process value binding expressions.
Resource Bundle
In the Base name field, specify the fully qualified class name of the ResourceBundle instance. In the Var field, enter the name that is used to retrieve the bundle.
Resource Handler (JSF 2.0 only)
Specify the fully qualified class name of the ResourceHandler implementation class that is used to render and decode resource requests.
State Manager
Specify the fully qualified class name of the StateManager implementation class that is called during the restore view and render response phases of the request processing lifecycle. The state manager stores the state of the current view between HTTP requests.
System Event Listener (JSF 2.0 only)
Define the details for a listener that is notified of system events that are application-scoped. Specify these fully qualified class names:
  • System event listener class : Called when events of the system event class are sent to the runtime environment.
  • System event class: Delivers events to the system event listener class.
  • Source class: The source of the event that is delivered to the system event listener class.
Variable Resolver
Specify the fully qualified class name of the VariableResolver implementation class that is used to process value reference expressions.
View Handler
Specify the fully qualified class name of the ViewHandler implementation class that is called during the Restore View and Render Response phases of the request processing lifecycle.

Behavior (JSF 2.0 only)

The behavior element specifies behaviors that provide additional functionality for a UI component. Specify an ID and class for the behavior.

Attribute
The attribute element represents a named and typed value that can be configured on a UIComponent in order to affect the operation of the behavior. Specify an ID and class for the attribute, and default or suggested values for the attribute. If you set a default value, the attribute must take the value. A suggested value is optional.
Property
Property elements identify bean properties that can be configured to affect the operation of the behavior. Specify an ID and class, and default and suggested values for the property. If you set a default value, the property must take the value. A suggested value is optional.

Component

The component element represents a UIComponent implementation class that defines the state and behavior of a custom UI component and its associated properties and attributes. Specify a name and class for the component.
Attribute
Identifies a generic attribute recognized by the implementation logic of this component.

Specify an ID and class for the attribute, and default or suggested values for the attribute. If you set a default value, the attribute must take the value. A suggested value is optional.

Facet
Specifies the name and extension of the facet that is associated with a component.
Property
Identifies bean properties of the component class that may be exposed for manipulation. If you set a default value, the property must take the value. A suggested value is optional.

Converter

The converter element represents a custom converter implementation class that converts objects to strings or strings to objects. In the Create Converter window, specify an ID and class to associate with the converter.
Converter class
Specify the converter class that implements the class that you entered in the Create Converter dialog box.
Attribute
Identifies a generic attribute recognized by the implementation logic of this element. Specify an ID and class for the attribute, and default or suggested values for the attribute. If you set a default value, the attribute must take the value. A suggested value is optional.
Property
Identifies JavaBeans properties of the converter class that may be exposed for manipulation. If you set a default value, the property must take the value. A suggested value is optional.

Factory

The factory element defines the various factories that are used to create families of related or dependent objects.

Application Factory
Specify the fully qualified class name of the concrete ApplicationFactory implementation class that will be called when FactoryFinder.getFactory(APPLICATION_FACTORY) is called. This factory accesses the creation of an Application instance to change the way that Application instances are served.
Exception Handler Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete ExceptionHandlerFactory implementation class that will be called when FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY) is called. An exception handler can handle all exceptions globally.
External Context Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete ExternalFactory implementation class that will be called when FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY) is called. The external context allows JSF applications to run in a servlet or portlet environment.
Faces Context Factory
Specify the fully qualified class name of the concrete FacesContextFactor implementation class that will be called when FactoryFinder.getFactory(FACES_CONTEXT_FACTORY) is called. This factory controls the creation of FacesContext instances to change the way that they interact with the rest of the system.
Lifecycle Factory
Specify the fully qualified class name of the concrete LifecycleFactory implementation class that will be called when FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called. This factory adds, extends, or replaces the request processing lifecycle.
Partial View Context Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete PartialViewContextFactory implementation class that will be called when FactoryFinder.getFactory(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called. This factory allows applications to control partial view traversal, often during Ajax requests.
RenderKit Factory
Specify the fully qualified class name of the concrete RenderKitFactory implementation class that will be called when FactoryFinder.getFactory(RENDER_KIT_FACTORY) is called. This factory accesses the creation of RenderKit instances to change the way that RenderKit instances are served.
Tag Handler Delegate Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete ViewDeclarationLanguageFactory implementation class that will be called when FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called. This factory retrieves and stores TagHandlerDelegate instances.
View Declaration Language Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete ViewDeclarationLanguageFactory implementation class that will be called when FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called. This factory enables the replacement or decoration of JSF view declaration.
Visit Context Factory (JSF 2.0 only)
Specify the fully qualified class name of the concrete VisitContextFactory implementation class that will be called when FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is called. This factory controls how the tree is visited during lifecycle execution.

Lifecycle

The lifecycle element allows you to modify the behavior of the default life cycle implementation for the application.
Phase listeners
Click Add to add a phase listener and type the name in the Phase listeners list. The phase listener is notified of phase changes during the request processing life cycle.

Managed Bean

The managed bean element defines the managed beans that are dynamically instantiated at runtime if they are referenced as the first element of a value binding expression, and no corresponding bean is identified in any scope.

Specify the bean name, class, the scope in which to store the bean instance, and whether to instantiate the bean on application startup.

List Entries
Represents a set of initialization elements that are used to populate a managed property that is a list or an array. In the Value class field, specify a fully qualified class name of an object that all values are converted to before they are added to a list in the list entries element.
Null Value
Adding a null value to this element initialize a property that is enclosed in this element to null.
Value
Specify the value or expression that generates a value for this element.
Managed Property
Represents a individual property of a managed bean that is configured to the specified value, if the corresponding managed bean is automatically created. Specify the property name and class.
Map Entries
Represents a set of key-value pairs that are added to the value of a managed property of a java.util.Map type.
  1. In the Key class field, specify a fully qualified class of an object type to which all keys in this list of map entries are converted to.
  2. In the Value class field, specify a fully qualified class name of an object that all values are converted to before they are added to a map in the map entries element.
  3. To add entries to the list, click Add.
  4. In the Key field, enter a String representation of a map key that is in a managed property of a java.util.Map type.
  5. In the Value section, enter the value or expression that generates a value for this element in the Value field, or select the Null radio button to specify that a property that is enclosed in this element is initialized to null.

Navigation Rule

The navigation rule element sets rules to make decisions on which view to display next.

In the From page field, specify the page to navigate from. If you leave this field blank, the navigation rule applies to all views.

Navigation Case
Defines a set of conditions that must be met before the case is executed and which view to proceed to next.
  • From outcome Specify a string that the navigation handler compares with the output of the From action element or the action attribute of a UI component.
  • From action: Specify an action method that returns a string that indicates if the action method is successful. Use From outcome and From action together to define dynamic navigation.
  • If this expression is true (JSF 2.0 only) : Specify an EL expression that evaluates to true or false to define conditional navigation.
  • Go to page: Specify the page that the user is directed to if the From action and From outcome match.
Redirect
Triggers a new HTTP request for the view instead of rendering the response without a separate HTTP request. Click the Add view parameter to add a view parameter.
View Parameter (JSF 2.0 only)
View parameters make it possible for incoming request parameters to be handled on GET requests.
Specify the name and value of the view parameters. These parameters are included in the generated URL when your page uses an <f:viewParam> tag. When you declare a view parameter in the Faces configuration file, you can use EL expressions.

Referenced Bean

The referenced bean element defines the external beans that are available to this application at run time. Specify the name and class of the referenced beans.

RenderKit

The RenderKit element represents a runtime registry for renderers. A render kit can customize the look and feel of how pages are displayed in markup languages other than HTML, or how pages are displayed on different types of devices. Specify the name and class of the RenderKit.

Client Behavior Renderer (JSF 2.0 only)
Produces a script that implements the logic of the client side behavior.
  • Type: Specify the logical name of the client behavior renderer.
  • Class: Specify the fully qualified class name of the client behavior renderer.
Renderer
Responsible for encoding and decoding components in order for the components to render on a device.
  • Type Specify the logical name of the renderer.
  • Class: Specify the fully qualified class name of the renderer.
  • Component family: Specify the component family that a renderer links to.

Ordering (JSF 2.0 only)

Use the ordering element to specify that this configuration file is processed before or after a specific configuration file or a group of files.

After the following Faces configurations (optional)
A list of configuration files that you want to be processed before this configuration is processed. Select this check box to specify that this configuration file is processed last.
Before the following Faces configurations (optional)
A list of configuration files that you want to be processed after this configuration file is processed. Select this check box to specify that this configuration file is processed first.

Validator

The validator element allows you to add custom validators to your application. Specify an ID and class for the validator.
Attribute
Identifies a generic attribute that is recognized by the implementation logic of this element. Specify an ID and class for the attribute, and default or suggested values for the attribute. If you set a default value, the attribute must take the value. A suggested value is optional.
Property
Identifies bean properties of the validator class that may be exposed for manipulation. If you set a default value, the property must take the value. A suggested value is optional.

Feedback