سؤال

I have been working on a project and trying to understand how these components work. I am getting confused with the role each one plays. My current task is to take a project that is utilizing JSF, MyFaces, Trinidad and Facelets in Tomcat 5.5 and have it run in Tomcat 6.0. I am getting very odd behaviors when I run it in the new container. So I'm trying to figure out if I need to update any of these libraries. But I can't seem to figure out how these all work together. So here are some questions:

  • How do I figure out what version of JSF I have?
  • What is the difference between JSF, Facelets and MyFaces?
  • I read that trinidad is a JSF framework. So is this an extension of JSF?

Given this information, does the Tomcat version have a direct impact on these frameworks?

هل كانت مفيدة؟

المحلول

JSF is a component based MVC framework which is part of Java EE. JSF is merely an abstract specification (like as almost everything else in Java EE). To really use it, you need a concrete JSF implementation. Major JSF implementations are Mojarra and MyFaces.

MyFaces is one of the concrete JSF implementations. Mojarra is another one. You can find out the concrete JSF version by checking the MANIFEST.MF file in the JSF implementation JAR file.

Trinidad is a JSF component library. A JSF component library is an extension which is supposed to be used on top of an arbitrary JSF implementation. Component libraries usually offers additional components on top of the standard component set with more skinning, ajaxical and enhanced features. Ultimate goal is to minimize homegrown code and code repetition.

Facelets is a XML based view technology and the successor of JSP. It allows you to define JSF UI components by XML declarations and to inline plain vanilla HTML along it. A view file ultimately get parsed and converted to a UIViewRoot during view build time (restore view phase) and generates HTML during view render time (render response phase). This HTML is in turn been sent to the client side (open page in webbrowser, rightclick and View Source to see it).

As to your concrete problem, Tomcat 5.5 is a Servlet 2.4 container and thus you can only run at highest a JSF 1.2 implementation on it. Facelets is not bundled in JSF 1.x. You'd need to install Facelets 1.x separately. Tomcat 6.0 is a Servlet 2.5 container and thus you can run a JSF 2.0 implementation on it. Facelets is already bundled in JSF 2.0, so you don't (and shouldn't) install it separately. Then, when using Trinidad, make sure that you get a version compatible with the JSF spec version.

See also:

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top