Ismail Marmoush
Ismail Marmoush

Reputation: 13590

What are the basic components of a Java dynamic web app, and how JSF2.0 Facelets, and Myfaces relate to them?

I'm not a web developer, but I kinda know some basics, I wonna know what are Myfaces apache and facelets and how they relate to JSF2.0. I did my homework and wiki, googled them but it's still confusing. As far as I know for developing a Java based dynamic web application I will use some of the following:

Upvotes: 0

Views: 315

Answers (2)

Arjan Tijms
Arjan Tijms

Reputation: 38163

Java works a lot with specifications. The overall enterprise specification is called Java EE and contains the specification for among others JSF.

Specifications have implementations. For instance, JBoss AS and GlassFish both implement Java EE as a whole. They do this by a mix of own development and by incorporating (bundling) parts that are also individual projects and are individually developed.

For instance, JSF is implemented by two main projects: Mojarra and MyFaces (there is supposedly also an independent Chinese implementation, but that one isn't well known and is difficult to access)

Of those implementations, Mojarra has a special status; it's the reference implementation (RI).

Mojarra is bundled with among others JBoss AS as the default JSF implementation and with GlassFish as the only implementation. MyFaces is also bundled with JBoss AS, but needs to be explicitly chosen. Furthermore, MyFaces is bundled with the Apache implementations of Java EE: Geronimo and TomEE.

In JSF, the template language used to composite views (pages) is pluggable. This is called a VDL (View Description Language). In days past JSP was used for this, but because of this pluggability third parties could implement their own ones. For example, see Authoring JSF pages in pure Java and JavaFX as JSF VDL (View Description Language)?. The absolutely most popular one of all those alternative VDLs was Facelets. See e.g. this 2006 article: Facelets fits JSF like a glove

Because of the almost complete unsuitability of JSP and the raving popularity of Facelets, the JSF EG decided to adopt Facelets and incorporate this in JSF 2.0.

So both Mojarra 2.x and MyFaces 2.x include Facelets by default. It's a full and official part of JSF 2.0.

Finally, Tomcat is not a Java EE implementation but a Servlet container. It doesn't bundle anything but Servlet and JSP. You can however build your own stack on top of it, and then choose to bundle either Mojarra or MyFaces with it. Again, remember that you DO NOT need to bundle Facelets separately if using the JSF 2.x version, since both ALREADY INCLUDE Facelets.

Upvotes: 3

ClickerMonkey
ClickerMonkey

Reputation: 1941

JSF 2.0 is a specification, Facelets is now a part of JSF 2.0 (previous to 2.0 it was a separate library), Myfaces is an implementation of JSF2.0 by Apache.

Upvotes: 1

Related Questions