deffury
deffury

Reputation: 21

Is JSF a component based specification or is it really facelets based specification

JSF : As per Wikipedia, JSF is a Java specification for building component-based user interfaces for web applications.

Facelets : is an open source Web template system under the Apache license and the default view handler technology (aka view declaration language) for JavaServer Faces (JSF).

So my question is

  1. Is JSF a component based specification or is it really facelets based specification, since all those components are really set on facelets by default.
  2. Can we say facelets is a component itself or a feature of JSF, since JSF also communicates callbacks via backing beans.

Upvotes: 2

Views: 177

Answers (1)

BalusC
BalusC

Reputation: 1109635

JSF can use any view technology. Previously this was JSP. Then it was Facelets. Via the ViewDeclarationLanguage interface you can define and plug your own. Even a Java based one as Arjan Tijms ever blogged about: Authoring JSF pages using pure Java.

The view technology basically specifies the way how you define the JSF component tree. JSF builds the component tree (the UIViewRoot instance) based on the view and then processes the request based on the component tree and then renders the response based on the component tree. This all happens completely independent of the view technology used.

Knowing that fact, the answers are more straightforward:

  1. Facelets is just the default view technology of JSF (at least, since JSF 2.0). The component tree is not set in Facelets, it's set in UIViewRoot instance.

  2. Facelets just offers an easy way of defining JSF component tree via XHTML+XML, a markup language very suitable for embedding HTML code and converting to HTML.

See also:

Upvotes: 4

Related Questions