JSF does not have a good press, and a bad reputation is unfortunately justified (another missed opportunity of the late Sun Microsystems). But BUT has changed a lot since the question was asked - a new version of JSF 2.0 was released.
So what happened to JSF 1.X, which made him think in comparison with Stripes, Spring MVC or Wicket, Play, Click, etc.?
- Only POST requests were supported, which caused performance problems (GET requests can be cached efficiently), it’s hard to get bookmarks and other URLs
- JSF 1.X was based on JSP pages that were not suitable for handling the more complex JSF page life cycle.
- Component creation was complex and cumbersome.
- The definition of navigation rules was far from flexible and very detailed.
- Mandatory XML configuration
- There is no clean resource management method
It’s good that all these shortcomings were resolved by the new version of JSF.
- GET and POST requests are equally well supported.
- Configuration can be done using annotations (we can stick with XML, where is the best solution), definitions of navigation rules are simplified, we can even use a customization convention.
- Creating components is very simple.
- New and very useful areas have appeared: the scope and flash memory (similar to what is known from Ruby on Rails), which allow users to handle more complex threads.
- There is a standard resource management method and an improved error handling mechanism.
- We can define the stages of a project to simplify project management in various environments (testing, production, etc.).
- XHTML-based Facelets have replaced JSP as the best alternative to view definition
- Support for embedded AJAX requests
- JSF is part of the Java EE standard, which means they are not going to fade overnight if bored developers decide to move on to the next brilliant and more fashionable structure.
And last, a huge advantage of JSF 2.X: tones of well-designed, great looking and well-prepared components (RichFaces, PrimeFaces, ICEFaces). These libraries provide hundreds of commonly used pages on WWW pages that are accessible without writing a single line of JavaScript or CSS. This is a huge increase in productivity.
However, JSF may have performance issues compared to action-based frames such as Stripes, which work more closely with HTTP requests without building a component model (which uses more memory, more network bandwidth).
But for an application that should not be extremely efficient, JSF 2.0 is a very good and rational choice. The learning curve is no longer as steep as it is plus the ability to reuse existing components makes it really attractive. Looking from this point of view, stripes are not so attractive.
So, for example, for a corporate intranet application used by 2,000 employees, JSF 2.0 would be a great choice.
Piotr kochański
source share