What is the difference between JSP and Facelets?

I just started reading the Java EE 6 Tutorial , and I'm a little confused! I knew about JavaServer Pages (JSP) and even did some encodings while I was undergraduate. But now, in this tutorial, I don’t see anything about the JSP.

Instead, I read about Facelets, the new presentation definition framework (as described in this lesson). I searched several times over the Internet to clarify the difference between JSP and Facelets, and I came across this post that helped me a lot (especially BalusC's answer ). But these terms are still a bit unclear to me.

What is the difference between JSP and Facelets? Are Facelets replacing JSPs, or is it just technology that works better with JSF (and if this is the last, why)? If they differ from each other, when should I use each of them?

+15
java jsp facelets
04 Feb '10 at 3:28
source share
1 answer

As you can read from the tutorial,

The term Facelets is used to mean a definition of the appearance of the JavaServerTM Faces Frame, which is a page language declaration that has been developed for use with JavaServer Faces. In the form of JavaServer Faces 2.0, Facelets is part of the JavaServer Faces specification, and is also the preferred technology for creating JavaServer Faces-based applications.

Now JSP is the standard viewing technology for the Internet. But when it comes to adopting JSF as a web framework, JSP does not support all the features provided in JSF 2.0. Therefore, to work with JSF 2.0, some standard viewing technology was required. So Facelets is easy.

If you do not work with JSF at all, you do not need to use Facelets. You can go with JSP in this case. Or there are some more template frameworks like FreeMarker and Velocity. Moreover, some web frameworks define their own premium, such as Struts2. Therefore, if you decide to go with Struts, using Struts markup is the way to go.

+11
Feb 04 2018-10-02T00
source share
β€” -



All Articles