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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:40:40+00:00 2026-06-11T11:40:40+00:00

This my first experience in developing applications based on a Java EE architecture and

  • 0

This my first experience in developing applications based on a Java EE architecture and I am using

  • JSF 2.0
  • Spring 3.1
  • JPA 2.0

I want to ask you please about an issue which I am a little bit confused with. I want to declare my JSF managed bean but there’s many solutions to deal with this constraint:

  1. Declare the manged bean in the faces-config.xml.
  2. Override my controller with @ManagedBean annotation.
  3. Override my controller with @Controller annotation.

My question is : what’s the diffrence between these three solutions ?! and what changes should i make on my ApplicationConfig.java or/and web.xml ?! And concerning Spring , should i put some kind of listeners in my web.xml ?!

I really tried to read many tutorials and examples but each time i find myself blocked !

  • 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-06-11T11:40:41+00:00Added an answer on June 11, 2026 at 11:40 am

    When integrating Spring and JSF you really can’t be a beginner in either technology, because they don’t play well together. My first and best advice to you is to get a few books on JSF and Spring and really understand both separately before attempting to integrate them.

    With that being said, JSF is a component based web framework with an emphasis on MVC. Spring is a Dependency Injection and Inversion of Control framework that is not exclusive to web applications.

    If you don’t understand these three terms are:

    • Component based web framework

    • Dependency Injection

    • Inversion of Control

    Then my suggestion is that you just stop what you are doing and immediately begin reading.

    The main problem with integrating these two things is that there is some overlap in responsibilities between the two frameworks that need to be addressed. JSF as a standalone framework maintains the scope of its own managed beans without the need for a seperate DI framework. When introducing Spring however then there are naturally going to be conflicts. Spring manages its own Beans apart from JSF, so to reference these ManagedBeans and have business objects or DAO’s be properly injected into them for use, the JSF ManagedBeans need to become Spring Controllers.

    You can declare a JSF ManagedBean with the @Controller annotation. Spring 3 is smart enough to recognize that it is a JSF managed bean and the bean name will be whatever the name is declared as for the ManagedBean.

    @Controller
    @Scope("session")
    @ManagedBean(name="testBean")
    

    Now that this is handled, the next problem is that pesky EL Resolver that came with your JSF implementation. The EL Resolver does basically just that, it resolves EL expressions encountered on your XHTML/JSF page. When referencing testBean however it will not be able to resolve this name correctly as it is referring to a JSF managed bean by that name, and will not be able to find the Spring Controller with all the Spring injected dependencies that you need.

    Spring 3 solves this problem by providing you a custom EL Resolver to use in place of the one that comes bundled with your JSF implementation. You can declare it to be used in faces-config.xml

    <application> 
       <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> 
    </application>
    

    Now finally:

    should i put some kind of listeners in my web.xml ?!

    If you are just integrating JSF + Spring without the need for any other Spring controlled Servlets or without the need for Spring Security integration then no you do not need anything additional in your web.xml. You would only need to declare the FacesServlet and its context params, plus any other third party component library servlets that may be necessary for your situation.

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

Sidebar

Related Questions

I'm developing a web system using regular PHP. This was my first experience with
I'm developing a game for android and this is my first experience with OpenGL.
This is my first experience with javascript, and... Well... Ugh. Here's what's happening: function
This is my first post and I my first experience with jquery. I have
Using Dozer to map two objects, I have: /** /* This first class uses
#include <iostream> using namespace std; // This first class contains a vector and a
I want to dive into developing applications for the Mac and later also for
I'm experienced in database systems. This is the first time I'm developing a web
I've been developing my first web based app for about two months now (I'm
I'm developing a win32 app in the C Programming Language. This is my first

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.