An Oracle blog about Java Technology

Why JSF Matters (to You)

Guest Author

      "Those who have knowledge, don’t predict. Those who predict, don’t have knowledge."

                                                                                                   – Lao Tzu

You may have noticed Thoughtworks recently crowned the likes of AngularJS, etc imminent successors to server-side web frameworks. They apparently also deemed it necessary to single out JSF for righteous scorn. I have to say as I was reading the analysis I couldn't help but remember they also promptly jumped on the Ruby, Rails, Clojure, etc bandwagon a good few years ago seemingly similarly crowning these dynamic languages imminent successors to Java. I remember thinking then as I do now whether the folks at Thoughtworks are really that much smarter than me or if they are simply more prone to the Hipster buzz of the day. I'll let you make the final call on that one. I also noticed mention of "J2EE" in the context of JSF and had to wonder how up-to-date or knowledgeable the person writing the analysis actually was given that the term was basically retired almost a decade ago. There's one thing that I am absolutely sure about though - as a long time pretty happy user of JSF, I had no choice but to speak up on what I believe JSF offers. If you feel the same way, I would encourage you to support the team behind JSF whose hard work you may have benefited from over the years.

True to his outspoken character PrimeFaces lead Cagatay Civici certainly did not mince words making the case for the JSF ecosystem - his excellent write-up is well worth a read. He specifically pointed out the practical problems in going whole hog with bare metal JavaScript, CSS, HTML for many development teams. I'll admit I had to smile when I read his closing sentence as well as the rather cheerful comments to the post from actual current JSF/PrimeFaces users that are apparently supposed to be on a gloomy death march. In a similar vein, OmniFaces developer Arjan Tijms did a great job pointing out the fact that despite the extremely competitive server-side Java Web UI space, JSF seems to manage to always consistently come out in either the number one or number two spot over many years and many data sources - do give his well-written message in the JAX-RS user forum a careful read. I don't think it's really reasonable to expect this to be the case for so many years if JSF was not at least a capable if not outstanding technology. If fact if you've ever wondered, Oracle itself is one of the largest JSF users on the planet. As Oracle's Shay Shmeltzer explains in a recent JSF Central interview, many of Oracle's strategic products such as ADF, ADF Mobile and Fusion Applications itself are built on JSF. There are well over 3,000 active developers working on these codebases. I don't think anyone can think of a more compelling reason to make sure that a technology is as effective as possible for practical development under real world conditions.

Standing on the shoulders of the above giants, I feel like I can be pretty brief in making my own case for JSF:

  • JSF is a powerful abstraction that brings the original Smalltalk MVC pattern to web development. This means cutting down boilerplate code to the bare minimum such that you really can think of just writing your view markup and then simply wire up some properties and event handlers on a POJO. The best way to see what this really means is to compare JSF code for a pretty small case to other approaches. You should then multiply the additional work for the typical enterprise project to try to understand what the productivity trade-offs are. This is reason alone for me to personally never take any other approach seriously as my primary web UI solution unless it can match the sheer productivity of JSF.
  • Thanks to JSF's focus on components from the ground-up JSF has an extremely strong ecosystem that includes projects like PrimeFaces, RichFaces, OmniFaces, ICEFaces and of course ADF Faces/Mobile. These component libraries taken together constitute perhaps the largest widget set ever developed and optimized for a single web UI technology. To begin to grasp what this really means, just briefly browse the excellent PrimeFaces showcase and think about the fact that you can readily use the widgets on that showcase by just using some simple markup and knowing near to nothing about AJAX, JavaScript or CSS.
  • JSF has the fair and legitimate advantage of being an open vendor neutral standard. This means that no single company, individual or insular clique controls JSF - openness, transparency, accountability, plurality, collaboration and inclusiveness is virtually guaranteed by the standards process itself. You have the option to choose between compatible implementations, escape any form of lock-in or even create your own compatible implementation! Open standards like JSF also tend to have strong out-of-the-box tools/IDE support.

As you might gather from the quote at the top of the post, I am not a fan of crystal ball gazing and certainly don't want to engage in it myself. Who knows? However far-fetched it may seem maybe AngularJS is the only future we all have after all. If that is the case, so be it. Unlike what you might have been told, Java EE is about choice at heart and it can certainly work extremely well as a back-end for AngularJS. Likewise, you are also most certainly not limited to just JSF for working with Java EE - you have a rich set of choices like Struts 2, Vaadin, Errai, VRaptor 4, Wicket or perhaps even the new action-oriented web framework being considered for Java EE 8 based on the work in Jersey MVC...

Please note that any views expressed here are my own only and certainly does not reflect the position of Oracle as a company.

Join the discussion

Comments ( 8 )
  • alex Thursday, June 12, 2014

    How many high-profile, modern web sites does JSF power? Something along the lines of Amazon, Ebay, Facebook, Twitter or any of Google's solutions.

    JSF is nice if you only have Java developers to do the job. If not, almost anything else is a better choice.

  • Reza Rahman Thursday, June 12, 2014

    Sounds like an honest answer to this question will surprise you.

    The reality is that many of what most folks would count as "high profile" sites in fact do use JSF. Some such "names" include eBay, Geico, PayPal, Garmin, AutoTrader, HP, Intuit, Ford, Kodak, LexisNexis, Wyndham, Boeing, BMW, Volvo, Mercedes Benz, Ericson, Lufthansa, Sungard, Harvard and pretty much every other global/US Fortune 500-1000 that one can imagine.

    To get just a small partial list, you can go here: http://trends.builtwith.com/websitelist/JavaServer-Faces?var=a.

    We are actually having eBay come to JavaOne 2014 to talk about how they are scaling JSF for their needs.

    That being said, from a personal standpoint I can agree that JSF is principally geared towards heavily form driven business applications where Java developers are involved in writing most of the UI code. From what I have seen, this actually turns out to be most Java server-side applications these days.

  • alex Thursday, June 12, 2014

    Actually ebay and PayPal really are surprising entries (to me). Thanks for the speedy answer, I tried googling for these and found a much shorter list instead.

    And you've piqued my interest about eBay, I have always thought scaling was one of JSF's weaknesses (haven't used it in a while though).

  • Reza Rahman Thursday, June 12, 2014

    With all due respect from my perspective "JSF doesn't scale" has been part of the long standing (accidental or deliberate) FUD campaign against JSF - which is why we are having eBay speak on the topic (later to release the video to the community). Personally, I have not seen this supposed problem myself from a practical standpoint over many years.

    Sometimes it saddens me some of the tactics some people in the Java community resort to using in the name of "winning" (winning what frankly remains a mystery to me).

  • alex Thursday, June 12, 2014

    I'm trying to filter out the FUD as well as I can. My concern is having to distill everything into HTML and JS first, as opposed to having those as static resources, potentially served directly from a dedicated HTTP server. And I don't know how efficiently generated resources can be cached.

    But I haven't been involved in any large-scale project involving JSF, thus my interest in what eBay will have to say about it. I try to listen to guys with first-hand experience first and foremost.

    Also, no one wins if someone loses in the process. Programming is not a war, it's a perpetual quest for a solution that's better than the last one.

  • Ed Burns Thursday, June 12, 2014

    Thanks for this blog post. I hope it stands as a counterweight to the occasionally under-substantiated anti-JSF meme.

    Also, I'd like to highlight the superb job done by the Java IDE's for JSF support. NetBeans, IntelliJ, Idea, Eclipse (with plugins) and JDeveloper all have very broad and deep JSF support. Check out this YouTube tutorial from John Yeary where he shows off the "Refactor as composite component" wizard. You can skip to 5:51 if you like. < https://www.youtube.com/watch?v=3naznoZ1SKI >.

    Ed Burns

    JSF Spec lead.

  • Reza Rahman Thursday, June 12, 2014

    All web frameworks pay some processing/caching cost and where content gets served from really is not a significant concern overall that I have seen.

    Just to make sure, in reality I am actually someone with many years of fairly diverse "first hand experience", perhaps more so than some of the people that produce what looks suspiciously like FUD to me.

    Your point about evolving solutions is well taken. The way I see it the JSF ecosystem does an excellent job of evolving towards an ever improving solution on an already great one.

  • guest Friday, June 13, 2014

    JSF is part of Java ->enterprise<- , and for such a web applications used in enterprises, which are most often used to manage data, jsf is right tool- because of it's statefulness and event driving. It allows to code frontend as a desktop application (Swing), which makes working with complex forms easier.

    Most of the time all I need to do is to get some component from Primefaces (like datatable) and bind it to data- so simple. I think expecting JSF to be the framework to build WWW sites is a mistake, because it was not designated for this purpose.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.