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 7574939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:33:40+00:00 2026-05-30T16:33:40+00:00

We have a JSF 2.0 application running under Glassfish 3.1.1 which has been moved

  • 0

We have a JSF 2.0 application running under Glassfish 3.1.1 which has been moved forward from JSF 1. This mean that I have a faces-config.xml saying

<managed-bean>
    <managed-bean-name>OnlineBeanHandler</managed-bean-name>
    <managed-bean-class>X.jsf.OnlineBeanHandler</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
            ...
</managed-bean>

which was done to allow using #{OnlineBeanHandler} in my facelet pages. Works well. I can also use @javax.inject.Inject inside OnlineBeanHandler to get a CDI managed bean which I can then provide an alternative for by marking it @javax.enterprise.inject.Alternative and enabling it in beans.xml. Works well.

Now I need to have the same mechanism working for OnlineBeanHandler itself – i.e. have the <managed-bean>-handling code invoke my alternative class instead of the one explicitly named, but when following the same steps, I still get my base class instead of my alternative.

Can this be done directly and if so how?


Apparently this mechanism does not work there. In the current situation, we could do with creating yet another faces-config.xml file and just have those to be overridden by projects there. A replacement faces-config.xml is then provided by each project.

  • 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-30T16:33:41+00:00Added an answer on May 30, 2026 at 4:33 pm

    Those two types of manages beans are exclusive. CDI Alternatives only work for CDI managed beans, not JSF manages beans. You could remove the XML snippet in faces-config and add @Named then you will be able to use @Alternative.

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

Sidebar

Related Questions

I have a JSF 2.0 application running on GlassFish v3. It has EJBs that
I have Enterprise Application with EJB3 and JSF on Glassfish server. After running this
I have a Java-JSF Web Application on GlassFish, in which I want to use
I have a JSF 1.2 application that has a session going on and whenever
I have a JSF application that uses mostly Richfaces. I would like to introduce
I have a JSF application with several major components and a component tree under
In a JSF 2 application, which is developed on tomcat, I have the following
We have JSF web application that generates XLS file and gives user link to
I have a legacy JSF application. Now that we want to add i18n support
i have a jsf application running on tomcat 6.0 and somewhere in the app

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.