1

JSF and Spring are two different web frameworks. I would like to ask two questions to clear things in my head:

  1. what is the purpose to use this 2 frameworks together ?
  2. i have heard that JSF is for view tier. So can we make a complex web application containing a business logic only with JSF?

Could someone explain? Thanks

Kruszon
  • 13
  • 2
  • Keep in mind that JSF is an MVC controller for the view part of a web application. It could be comparable to Spring MVC, not to Spring framework itself. Spring framework can do DI, provide its own built in libraries for integration with JPA for example and so many things. You can use Spring framework not only in web projects, but in every single project you init that requires a minimal architecture. – Aritz Aug 29 '13 at 10:20
  • Related/dupe: http://stackoverflow.com/q/18369356/ – BalusC Aug 29 '13 at 11:13

1 Answers1

-4

Ans 1. We integrate two frameworks to exploit best features of both of them.

In your case JSF is one of the best framework for view(UI) part and spring is good at maintaining beans because of its feature DI(Dependency Injection).

Ans 2. the main goals of creating jsf were

  1. Create a standard UI component framework that can be leveraged by development tools to make it easier for tool users to both create high-quality UIs and manage the UI’s connections to application behavior.
  2. Define a set of simple, lightweight Java base classes for UI components, component state, and input events. These classes will address UI lifecycle issues, notably managing a component’s persistent state for the lifetime of its page.
  3. Provide a set of common UI components, including the standard HTML form input elements. These components will be derived from the simple set of base classes (outlined in #1) that can be used to define new components.
  4. Provide a JavaBeans model for dispatching events from client-side UI controls to server-side application behavior.
  5. Define APIs for input validation, including support for client-side validation.
  6. Specify a model for internationalization and localization of the UI.
  7. Provide for automatic generation of appropriate output for the target client, taking into account all available client configuration data, such as the browser version.
  8. Provide for automatic generation of output containing required hooks for supporting accessibility, as defined by the Web Accessibility Initiative (WAI).

yes you can create a complex application only with JSF but its lot easier to use it with some other framework like Seam , Spring etc

Source JSF Complete reference

ankit
  • 4,919
  • 7
  • 38
  • 63
  • Thank you that clears a bit. Could you tell a little more how we handle logic with pure JSF? In spring we have service tier that controllers call to, what about jsf ? – Kruszon Aug 29 '13 at 09:34
  • @Kruszon in JSF you can directly bind your back-end methods to jsf component with the use of action for example in a button you can add action="#{yourBeanName.yourMethod}" this will directly call your method of back-end class, and great thing about it is you can use as many back-end classes as you want – ankit Aug 29 '13 at 09:36
  • Wow, that's nice. So we can call back methods from jsf or facelets pages, am i get it right? Generally, does JSF come with MVC pattern like Spring MVC does? Than what is a controller? Sorry for bothering you with more questions, i'm just a newbie here – Kruszon Aug 29 '13 at 09:45
  • I also dont have much knowledge just learning it for more info you can refer jsf complete reference book. – ankit Aug 29 '13 at 09:47
  • Yeah i know, but it's a ton of paper when simple talking with someone who know it benefit much faster. Thank you anyway for helping. – Kruszon Aug 29 '13 at 09:49
  • 3
    -1 for [plagiarizing](http://meta.stackexchange.com/questions/160077/ive-been-accused-of-plagiarism-what-do-i-do) content. Please mention the source and put citations in quote blocks, instead of doing as if it are your own words. – BalusC Aug 29 '13 at 11:15