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, all the front-end (static) with HTML, CSS and Javascript, using modern layouts.
My mission will be to transform this static front-end into a functional java web application that meets the requirements, among them, maintaining the original front-end layout.
Knowing that JSF is a tool that generates HTML, will it meet all my requirements? Or I should look for an alternative that I have more control of the generated HTML, such as JSP?
You have no more control over the generated html using JSP than using JSF. You may have better things but JSF will do. You will only have to modify some tags in the designer’s HTML in order to point to the properties and methods of your Beans. You can even teach the designer to make this link to test Beans and to use JSF tags when applicable instead of html tags. A good singer can learn this. I’ve seen a few who have, in Java and other platforms. Another option is you first backend each page or each part of the page and the designer act next.
– Caffé
Bruno, as far as I know, jsf version 2.2 supports custom attributes (
Pass-through attributes
) which you can use to make configuration using your javascript framework or components. Another way is to write your own components, where you control the behavior and the generated Markup. I believe that everything you can do with JSP, you do better with Facelets (I may be wrong). In addition, JSP is an older technology, and facelets incorporate many more advantages than jsp. (e. g: UEL).– Wakim
As for the JSF itself, I don’t know if it’s the best alternative, because its integration with front-end frameworks (Angular, Knockoutjs, Ember, React, etc.) is quite complicated, but it’s possible. Another problem is the component libraries, which have a lot of css and need to be overwritten, which makes it difficult to use a CSS framework (Bootstrap, Foundation and etc...). But you can take into consideration the possibility of building Webservices in Java EE as well.
– Wakim
I’ve done a job like this using JSF 1.2 and it worked. It was a bit of a hassle. You need to know what the component renders. nor try to apply a front-end framework. for this I suggest html statico and the java-rs that would be mounted its api.
– heat
@Wakim The JS frameworks you described are to facilitate the implementation of single-page Applications and have nothing to do with getting ready the views in HTML and CSS from the designer; likewise, if the views are already ready, no JSF component library will be used.
– Caffé
@Caffé, I agree, but it is possible to use these frameworks without routing, only with Data Bind, Template and etc, which is already very interesting. I already worked on a project where Primefaces and Knockoutjs were used, to take advantage of several of the Primefaces features that JSF adds but trying to have a larger processing in Javascript to reduce the load on the server. In the end we finished the components based on Primefaces but with our own
Renderer
to generate a Markup interacting with Knockout.– Wakim