Is JSF 2.2 suitable for modern HTML and CSS?

8

I will develop several web applications, and in most of them, besides receiving the documentation with the requirements, I will receive from a good web designer, the entire front-end (static) with HTML, CSS and Javascript using modern layouts.

My mission will be to turn this static front end into a functional web java application that meets the requirements, including maintaining the layout of the original front end.

Knowing that JSF is a tool that generates HTML, will it meet all my requirements? Or should I look for an alternative to having more control over the generated HTML, such as JSP?

    
asked by anonymous 30.01.2015 / 20:08

1 answer

4

I caught up with a question like this about 5 years ago, at the launch of JSF2.1 and I chose to use JSF to do my projects. It was the worst decision I made, I'll try to set out some points:

  • "I will get a good web-designer all the html, css and javascript ...". If it's really a good web-designer it will give you several pages with functional jquery plugins. Modern layouts made with some css framework like bootstrap and html 5. In my epoch JSF did not support html5 tags, I actually did not accept anything other than the tags themselves, but now it looks better. When we talk about the rest I see problems, usually all the components of JSF (I used the prime) use tables and several well archaic structures to generate a html compatible with all the browsers. The result is that you will spend more time tuning JSF to do something like what you need than to reuse what the web designer has given you.
  • "Modern applications ..." usually require a lot of pranks and jquery libs that the designer will insert into the application and lots of ajax communication between the pages. At this point you start to have problems with JSF in the scripts part, because you will have to use the ajax part that it gives you, and abandon what the web-designer had predicted. Using JSON with JSF is simply not natural and you'll almost always find yourself writing conversions manually.
  • The "component" model that JSF uses is not suitable for traditional web applications, such as open web applications. This type of model consumes more memory and will require a more robust server depending on the number of accesses it craves. For these types of applications it is better to use something of the MVC type.
  • I think JSF is useful for creating traditional admin panel type applications. Applications that run away from traditional is better to use some tool that really gives you freedom. Since then I use JSP only as a template, even some components like select are written in pure html. Some will find this a return to the age of the caves, I prefer to think that so the component is rendered perfectly, without breaking any pixel of the layout, in devices of all sizes. And to me that's what matters at the end of the day.

        
    25.02.2015 / 03:14