Facelets has a lot of improvements over JSP as a view technology for JSF. This section provides an overview of the most important improvements of Facelets over JSP, starting with content interweaving, in the next subsection.
One of the things that makes the combination of JSF with JSP complicated is the problem of content interweaving. Although the situation is somewhat improved since JSF 1.2 and JSP 2.1, both technologies still create their own representation of a page in memory. This is not only inefficient, but can also generate problems if JSF components are mixed with non-JSF content. (Think of problems with regards to the order in which elements are shown in the rendered page, and for user interface elements that are not aware of each other.) For that reason, it is advisable not to make such mix-ups when using JSP.
Facelets fixes this issue by creating a single component tree. This tree contains both JSF components and non-JSF elements such as plain...