Social Media

Would you use JSF for your next project?

There was an excellent stackoverflow blog post last week about the “Brutal Lifecycle of Javascript Frameworks”. The article was about the speed at which Javascript UI frameworks(angularjs, angular, jquery and react) come into and fall out of fashion. The key metric for this post is questions per month on the framework, which is a reasonable metric to demonstrate these trends. Downloads would have been interesting too.

It got me thinking where are we with JSF, and my starting point was to superimpose JSF on top of the Javascript data –

Its hard to see clearly but JSF is in decline based on questions asked on Stackoverflow. If we remove Javascript we can see the decline started around 2013

That said the level of questions is fairly small, and the level is relatively stable

This post tries to understand the current state of JSF, and whether there is still a place for JSF in modern development.

What is JSF?

JSF is a component-based web framework that is part of Java EE. It was the only frontend framework under Java EE until Java EE 8 added its new MVC framework.

Whats good about JSF?

For me the key strength of JSF lies in the component frameworks in the JSF ecosystem. In particular PrimeFaces, or the utility libraries like omnifaces. They let you quickly get started on projects, have plenty examples and are especially suited in a team or for projects where developers lack frontend skills. The deployment model is often simple, with a single war or ear file per server

The current release of JSF is 2.3, with the specification for 2.4 currently in progress.

Whats bad about JSF?

In 2014 JSF received criticism from the thoughtworks techradar, which placed it on hold.

The main part of the criticism was that the JSF model is flawed as it –

“encourages use of its own abstractions rather than fully embracing the underlying web model”

They do make the concession that the web model is getting more prominence in later versions of JSF.

There were rebuttals against this post particularly relating to more recent JSF versions. But it has contributed to JSF being regarded as a difficult framework to use.

JSF is Marmite

JSF is the marmite of frontend development.

Whats marmite? Its a yeast extract that you spread on toast. Some people love it, some hate it, but there is no middle ground. For the record I hate marmite, but I like JSF.

The reason I like JSF is that you can access good quality components, that are mature and well documented. It also has the advantage of allowing teams that are weak on front end skills to develop professional looking websites. There is a downside that it can be hard to deliver more complex requirements as the Request/Response model is more abstract under JSF.

Should you use JSF for new projects?

The JSF model has fallen out of favour. It is viewed as a legacy framework against today’s Javascript frameworks with RESTful API backend’s. This has moved the Java to implementing the RESTful microservices. This approach can often scale better than JSF.

The stackoverflow blog post shows its not all plain sailing in the frontend Javascript world. The frameworks suffer from relatively short lifespans, although there are migration strategies, you do run the risk of your javascript framework being obsolete.

JSF has the advantage of being a mature model in this respect. Its also worth remembering that if your team is lacking in front end skills then JSF will help you quickly deliver a professional looking website.

Question

I’d be interested in hearing other peoples experiences, and whether they will be using JSF on future projects

About the Author Martin Farrell

My name is Martin Farrell. I have almost 20 years Java experience. I specialize inthe Spring Framework and JEE. I’ve consulted to a range of businesses, and have provide Java and Spring mentoring and training. You can learn more at About

follow me on:

Leave a Comment:

4 comments
PZA says 22/01/2018

I think I’m a unicorn in respect to whether I love or hate JSF. I think it cool and powerful and stable. I think it works well for some projects and no so much for others.

Reply
    Martin Farrell says 23/01/2018

    I think its got a niche – someone one dzone was talking about using it for admin or internal applications, where the aim is to build it reasonably quick

    Its interesting that the responses on this article also said to use angular or React, especially since the stackoverflow article showed how short a lifespan these frameworks can have. I think there is a flawed business case there – you are basically building something on a framework that may only exist 2 years

    Reply
Chris D says 23/01/2018

Some interesting analysis! There is one flaw in your logic. You presume that less activity on StackOverflow’s JSF tag is an indication of less interest in JSF. However, the feature set of JSF has improved, and therefore people don’t get themselves backed into corners as often with the framework itself. Additionally, many of the questions may have been asked, and more easily found from searches. They may be using JSF more but needing to ask questions less. There could also be a shift in questions from the JSF framework itself to Primefaces, Omnifaces, and other libraries that work with JSF where the JSF tag is not included. It’s impossible to say how much this will affect the trend lines.

I personally feel JSF is a fairly awkward framework which has been patched over the years to make it a lot less awkward. JSF would have died a lonely death if the incredible BalusC had not been there on StackOverflow to answer everyone’s questions with great kindness and authoritative knowledge. That said, in the Java world, I’m not sure if there are any better alternatives.

Reply
Bartosz Jedrzejewski says 20/02/2018

I remember enjoying JSF, but that was probably because I was not familiar with the modern JavaScript development. At the moment I don’t think JSF is a future proof technology. The sort of front-end experience required nowadays is not very compatible with the JSF request-response model. JSF components are too difficult to edit to make them fit for building very responsive and dynamic websites.

The only niche for JSF that I can see is building very simple internal website where the cost is the main driver. But even then… if you know some basic JavaScript frameworks, you may find them easier to work with.

I think the future really is with React, Angular and the like and we (the Java developers) have to face it. In the end what is learning React when you have already been through the joys of Java Enterprise?

Thank you for that blog post! Was a fun read!

Reply
Add Your Reply