Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6664187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:34:57+00:00 2026-05-26T02:34:57+00:00

After the JSF 2 big support for annotations, I’m wondering what I would use

  • 0

After the JSF 2 big support for annotations, I’m wondering what I would use the faces-config.xml for. What is its importance now?

In other words, what are the configurations that can only be done through faces-config.xml and not via annotations?

Right now all what I am using it for is to declare Spring’s EL resolver.

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">

    <application>
        <el-resolver>
            org.springframework.web.jsf.el.SpringBeanFacesELResolver
        </el-resolver>
    </application> 
</faces-config>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:34:58+00:00Added an answer on May 26, 2026 at 2:34 am

    It’s still to be used for many things which can’t be annotated. E.g. custom JSF validation messages:

    <application>
        <message-bundle>com.example.i18n.messages</message-bundle>
    </application>
    

    A global i18n bundle (so that you don’t need to declare <f:loadBundle> in every view):

    <application>
        <resource-bundle>
            <base-name>com.example.i18n.Text</base-name>
            <var>text</var>
        </resource-bundle>
    </application>
    

    Explicitly supported i18n locales (so that the not-declared ones will be ignored even though there’s a message bundle or resource bundle for it):

    <application>
        <locale-config>
            <default-locale>en</default-locale>
            <supported-locale>nl</supported-locale>
            <supported-locale>es</supported-locale>         
            <supported-locale>de</supported-locale>         
        </locale-config>
    </application>
    

    Custom view handlers:

    <application>
        <view-handler>com.example.SomeViewHandler</view-handler>
    </application>
    

    Phase listeners (there’s still no annotation for that):

    <lifecycle>
        <phase-listener>com.example.SomePhaseListener</phase-listener>
    </lifecycle>
    

    Managed beans which can’t be annotated (the below one gives current Date on #{now}):

    <managed-bean>
        <description>Current date and time</description>
        <managed-bean-name>now</managed-bean-name>
        <managed-bean-class>java.util.Date</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    

    Custom factories, such as custom exception handler factory (it also allows factories for FacesContext, ExternalContext, LifeCycle and many more so that you can provide your custom implementation):

    <factory>
        <exception-handler-factory>com.example.SomeExceptionHandlerFactory</exception-handler-factory>
    </factory>
    

    To name only the commonly used ones. If you have faces-config.xml tag autocompletion in your IDE, you can find them all out. Only the managed beans, validators, converters, components, renderers and point-to-point navigation cases are not needed anymore thanks to the new annotations and implicit navigation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which JSF 1.2 component is responsible for instantiating managed bean specified in faces-config.xml? I'd
I'm going to use Saxon-B 9 in my JSF 2.0 project. But after adding
After the suggestion to use a library for my ajax needs I am going
After migrating JSF from 1.2 to 2.0 I begin to receive exception after submitting
I am using jsf reach faces in one application. I am using rich:modalPanel for
I have Enterprise Application with EJB3 and JSF on Glassfish server. After running this
I have one method on JSF Managed Bean, i want after user call method,
Using Eclipse Helios, I tried to start a JSF based project. After having created
After the user is successfully logged in i would normally put some of his
In our application we use jsf,we have to redirect the user to home page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.