We do have many frameworks available in Java. Struts, Swing, JSF 2.0, Spring etc are used as per their priority. Actually, I don't know how many they are as well!
But, as I am fresher to Java, even learning after their architecture, I cannot decide which framework can be used with what type of Projects !
Also, I am confused with mixed use of framework like Spring + JSF. What is the benefit to it ?
Another thing making me confusing is about the UI components available in market. Like, we do have Primefaces, Ice-faces, MyFaces, Rich-faces. They may or may not have been supporting AJAX in-built. They may contains some bugs as well. What is best choice for Framework + UI component that can directly provide a best feet solution for any project ?
Right. It looks like the question is about everything. In particular it mentions Struts and Swing over the comma. Swing I am sure is also a farmework, but that is one of many non-web UI frameworks. There are also ORM frameworks and many other types of. May we call EJB and Spring frameworks? I bet we may. Bad thing is that while on the intuitive level we may often tell if something is a framework, I've never seen any good definition of what a framework in software is. In about 50% of cases we are talking about Web frameworks, Like Struts, JSF, Wicket, Velocity, HybridaJava or MVC part of Spring. There are about 50 of only Java web frameworks, all of a very very different nature and value, but comparing them is a real headache. Recently I have noticed a new and growing page about web frameworks on wickipedia. Way overdue, but it is excellent to have it now. The table there is a good start for comarisons.
There are no Silver Bullet.
If you can't choose one let your software architect choose it for your needs. Or you have to play with all of them.
Swing is not a webbased framework. It's a desktop UI framework. You're probably confusing with Spring MVC.
All of those frameworks are dividable in two kinds:
A component based MVC framework is seen as a further evolution of request based MVC framework. Choose a component based MVC framework if you want more abstraction (i.e. you basically end up with a view and a model). Choose a request based MVC framework if you want more control over the controller part.
See also:
As a personal opinion, go for JSF 2.0.
See also:
Spring is more an injection (inversion of control) framework. One may say, it's the alternative to EJB. Spring MVC is a request based framework.
See also:
MyFaces is another JSF implementation and for the remnant you only mention JSF component libraries. Those are meant to be used on top of a JSF implementation. Which one to choose depends on which one suits your functional requirements the best (skinnability, ajaxability, enhancability, etc).
As a personal opinion, PrimeFaces 2.0 looks the best.
See also:
There are Frameworks for different Kind of Problems.
JSF is a Web-Framework (or better an API for a Web-Framework) that's based on Servlets/JSP and is handling the Web-Frontend for you, while Spring is a framework to configure applications and tie application components together to a running application.
So you can build small components that are using a JSF Framework to create a Web-UI and interact with the user, using Hibernate to store and retrieve the data in the database and tie them together with Spring to create a full-fledged Web-Application.
Since JSF is just an API, you'll need an implementation, like IceFaces. If you are following the specs clearly, the implementation can be easily replaced. So you can switch from IceFaces to MyFaces without rewriting the full application.