Can anyone explain what is happening?

I participated in JSF + Facelets dev for a month or so. I used composition, insertion, definition and other tags from facelets. Is it hard for me to understand what faces really give me? What are its alternatives? What is View Handler Technology? I can not find good materials / online notes on the same. Can someone explain to the laity? What it is? Thanks

+4
source share
2 answers

Facelets is a viewing technology. Facelets is the successor to JSP. The only alternative is JSP, which practically does not support support for JSF components. If you leave Facelets aside and step back to the JSP, the real benefits of Facelets will be quickly clarified.

You can also find my answer in a useful question: What is the difference between JSF, Servlet and JSP? Facelets are also considered there.

+3
source

Without providing complete academic information about Facelets, here is what it gives you:

  • Firstly, the ability to create reusable HTML code that you write yourself: this is not possible with JSF (pre-v2). Facelets gives you more control over the results of your web pages.
    • In some editions, it was shown that you can view parts of your page too, but this is actually impractical, since there are many states on a web page, of which only the initial bare version is visible in the preview.
    • If you intend to use JSF for a public website, Facelets is essential for SEO, given that with JSF you have no control over what comes out of the standard JSF components.
  • Secondly: templates. The ability to define HTML blocks (read: Facelet compositions) that can be reused with tags such as ui: define and ui: insert.

There are other advantages, but right now you should know that these two are the reasons for using Facelets over JSF. In addition, JSF 2.0 contains a modified version of Facelets by default.

facelets benefits: http://www.ibm.com/developerworks/java/library/j-facelets/

+2
source

Source: https://habr.com/ru/post/1308967/


All Articles