What is the best front-end option for a Java Web Applications?



Backend Framework Guide

Java EE and Spring are both very good and very comprehensive frameworks for writing backends. Both of them should be able to do exactly what you want. I would recommend using whichever your team is familiar with but I’m going to stay out of the details since you will be able to make a high-quality application with either one very easily.


Frontend Framework Guide

As far as the front-end goes, I have personally gotten the best results out of creating a RESTful API and using that to send data to a front-end Javascript framework. Angular is really good for this. One reason for this is that the Javascript frameworks tend to provide a lot of power when it comes to writing good web front-ends. JSF is a server-side, component-based MVC framework, and that generally gives you less control over the HTML + JavaScript that’s being created and makes it a lot more difficult to write tests for.


Alert

I’ve also found that at large shops, you can’t always trust people to do things the right away. Separation of concerns is important, and I like using a JavaScript framework like Angular for the front-end because it goes a long way to keep front-end code out of the back-end. The JSF applications we have at my workplace are rather terrible because the developers abused things like sessions. The JSF code also lived in the same deployment as the backend. Instead of using web services and taking a service-oriented approach and keeping everything loosely coupled, we wound up with giant ‘blobs’ of code that ‘do everything’.


KeyPoints:

  1. Develop your backend as RESTFul API’s using Java EE or Spring.
  2. Then build your front end using any good Javascript Framework like Angular, React, Ember, anything really because all of these give you a huge amount of power and each of these is designed to be a separate front end to a restful backend of any type as long as that backend conforms to REST API standards.