mmierins
mmierins

Reputation: 3774

JSF Facelets and Servlet API?

Someone today tried to convince me that Facelets are built on top of Servlet API. Knowing that Facelets unlike JSP are never compiled to actual servlet Java classes, I'm wondering how that could be possible. If this happens then at what stage Servlet API abstract classes and interfaces get implemented?

Upvotes: 0

Views: 297

Answers (2)

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62874

The facelets aren't compiled to a Servlet or any other Java class instance. They are converted to a XML tree, which is then stored in an instance of the FaceletCache class.

More info:

Upvotes: 1

Kayaman
Kayaman

Reputation: 73578

Do you know the difference between API and implementation? The Servlet API may be full of abstract classes and interfaces, but the servlet implementation is not.

JSF has a FacesServlet which processes JSF related things, so yeah it's definitely built on top of the Servlet API.

Note that Facelets is actually the advanced templating system used with JSF (instead of using JSP), so I wouldn't say that Facelets is built on top of Servlets, but JSF is.

Upvotes: 1

Related Questions