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

  • Home
  • SEARCH
  • 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 4049304
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:55:41+00:00 2026-05-20T13:55:41+00:00

I would like to achieve this idealism : To have only 1 implementation for

  • 0

I would like to achieve this idealism :

  1. To have only 1 implementation for the JSF Bean container, like to use only Spring or Weld but not both. Currently i am using Spring for my backend, so i prefer Spring.
  2. To have only 1 annotation, to choose between @ManagedBean, @Named, @Model
  3. To be able to use all supported scopes, like @RequestScoped, @SessionScoped, @ViewScoped, @FlashScoped, maybe also @ConversationScoped
  4. The JSF Beans could be injected with spring-managed-services (The backend services), perhaps using @Inject or @Autowired

So far i’ve been finding no best combination to achieve these because as far as i know, please correct me if i am wrong, :

  1. @ManagedBean can not be injected with spring services ?
  2. @Named can be injected with spring services using @Inject, but @Named is using Weld. Can i just use spring to managed the @Named instead of Weld ?
  3. @Named doesnt support @ViewScoped and FlashScope ?

Please share your thoughts and experiences.

Thank you 🙂


UPDATE 15 March 2011

Found an interesting page that describes how to replace Jboss Weld with Spring as the JSR 299 CDI implementation. So basically, the question number 2 is answered. Number 1 is also answered indirectly since i can now inject spring services.

But still, the number 3 question remains. I would find very helpful if i can use the @ViewScoped and Flash Scope in the @Named, something like this article. Flash scope implementation has yet to be seen, but the closest one i can get so far is this page.

Hopefully, replacing weld with spring as the jsr 299 implementation will still enable me to use @ConversationScoped.

Gotta test things now, wish me luck 🙂


UPDATE 18 MARCH 2011

Successfully make use of Spring 3 instead of weld to do the @Named, @Inject. The important thing is to set the el-resolver in the faces-config.xml.

AFAIK, Spring 3 currently doesnt support CDI yet, so bye2 @ConversationScoped.

For the scoping, i must still use @Scope(“request”) or @Scope(“session”), but if i prefer the @RequestScoped (javax.enterprise.context.RequestScoped) and @SessionScoped, i can make use of the bridge provided from this article.

The Scope(“view”) for spring from this article works like magic 🙂

One problem remain though, how to pass objects between Scope(“view”)-beans ..
Wish me luck !


update

Ahhh .. finally done ..
Passing the variables using Flash provided by JSF2 really works like magic.
I dont need an 3rd party implementation for that.

So basically, i can do without weld, but with spring, with the common scopes available, including the view scope, dan can pass between beans using the flash object.

One thing missing is the conversation scope, which isnt a major problem to me yet.
Hopefully the future spring can support this conversation scope.

Cheers 🙂

  • 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-20T13:55:41+00:00Added an answer on May 20, 2026 at 1:55 pm

    Weld (actually, the reference implementation of JSR-299 Context and Dependency Injection, also known as Java EE 6 CDI) was less or more invented to supplant Spring in Java EE 6 environments. I would suggest to use Java EE 6 CDI instead of Spring. Why would you use a 3rd party framework when Java EE 6 provides the same functionality out the box?

    If the Spring backend really cannot be changed, then I’d suggest to stick to it and not to intermix with Java EE 6 CDI annotations to save yourself from confusions and maintenance headache.

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

Sidebar

Related Questions

Thanks for a solution in C , now I would like to achieve this
I would like to ask is there any way to achieve this functionality: I
I would like to be able to achieve something like this: class Zot {
In order to achieve this effect, I would like to know how I can
Now, this requirement may seem weird. But i would like to know how to
I would like to achieve this layout : my main activity layout ( main.xml
hi so basically i would like to achieve this: when a user clicks an
I would like to achieve something like this: SELECT col1,col2-(SELECT foo FROM table1) FROM
I'm not sure if this is possible or not, but what I would like
I would like to know how to achieve this in Razor. At the moment

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.