0

Even though i spend whole days developing a JSF application, i've never had any training on the matter and I have to admin I am a still confused how the whole JSF puzzle fits together. JSF just looks a bit thrown together to me.

  • jsf-api
  • jslt
  • facelets
  • myfaces
  • trinidad
  • tobago
  • jsp api

I'd be very grateful if anyone could give me a quick description of these components, which ones are standard, which ones can be left out, which ones can/need to be used together

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Hendrik
  • 1,355
  • 3
  • 11
  • 30

2 Answers2

3

JSP and JSTL

JSP has undergone many iterations, but this is the core Java EE dynamic page technology. This is a servicable API, but working with JSPs often means more manual management of code/resources.

JSTL is the JSP Standard Template Library. This is a set of standard JSP tags. Do not mix these tags with JSF tags; they belong to a different programming model.

JSF API

The JSF specification. This is the core of the JSF Model-View-Presenter framework. This specifies a simple set of core components and the core lifecycle artefacts. There are two widely known implementations: Mojarra (the open sourced Sun API) and Apache MyFaces. Part of Java EE 5 and above.

Facelets

A view technology designed for JSF. Use this instead of JSPs. You cannot use JSP tags in Facelets views. This is not standard in Java EE 5, but is standardized in JSF2 (and therefore the upcoming Java EE 6). The better templating provided by Facelets often means you can rely less on 3rd party libraries.

Facelets provides some tags that look like JSP JSTL tags, but don't share any code. These tags should generally be avoided too (see Facelets doc for advice).

Apache Trinidad and Tobago

These are JSF libraries that provide components and other facilities. Because the core set of controls is rather basic, it is common to use such libraries, especially if Facelets is not used. These are not part of the Java EE standard. Library compatibility varies. See also jsfmatrix.net.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
McDowell
  • 107,573
  • 31
  • 204
  • 267
  • I don't advocate a blanket ban on JSTL tags - folk should read the documentation and judge for themselves. It is an area where people run into problems, particularly when they bring their JSP expectations into JSF apps and treat it as just another tag library. Intermingling JSF and non-JSF tags requires a detailed understanding of both lifecycles (and often feels to me too much like programming to the implementation and not the abstraction). You are right about the functions, though. New apps should try to use Facelets - it is a better fit. – McDowell Nov 20 '09 at 10:15
  • Isn't JSTL the JSP Standard Tag Library? – InverseFalcon Dec 17 '09 at 23:02
2
  • jsf-api are the interfaces and classes in javax.faces
  • jstl is a standard set of tags (used primarily in JSP) - most of them are replaced with JSF-tags, btw
  • facelets is a presentation and templating framework (like jsp)
  • myfaces is an implementation of the JSF standard. The other possibility if JSF RI (reference implementation)
  • trinidad and tobago are component libraries - some goodies that aren't included in the default set of jsf components
  • jsp is the alternative to facelets (or vice versa), which is as well a presentation framework.
  • UEL - (you didn't ask, but it's important) - Unified Expression Language - the set of rules for your #{..} expressions
Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140