Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

First of all, JSF 2.0 support both JSP and facelets files. In theory you can change your JSF implementation version and keep using your old JSF 1.2 libraries. But it is usual that the same JSF 2.0 library alternates does not work as expected, because they could target only facelets as View Declaration Language (VDL). One known example is MyFaces Tomahawk that was written in that way to keep it closer to the spec.

If your are already working with facelets, the necessary changes are minimal, but if you are working with JSP it is a good moment to change to facelets for JSF 2.0. In that way you'll enjoy all cool features like:

  • Partial State Saving
  • Composite Components
  • JSF 2.0 Resource Handling
  • JSF 2.0 Ajax

When migrating JSF 1.2 (or even 1.1) applications, keep in mind that JSF 2.1 has some improvements that makes easier convert JSP applications into facelets applications. It is strongly suggested to move directly to JSF 2.1.

Moving from .jsp to facelets .xhtml

Just follow the checklist:

  • Rename your files to .xhtml.
  • update all your headers.
  • replace your jsp:include with ui:import.
  • remove your f:verbatim tags.
  • update your faces-config.xml navigation rules.

Upgrading .jspx files

You can configure facelets engine to process .jspx files instead JSP, minimizing the necessary changes required for your application. To do that, follow this list:

TODO...

In resume, with JSF 2.1 the following features were added:

...

  • Configure facelets engine to handle files in different ways using <facelets-processing> tag inside <faces-config-extensions> entry on faces-config.xml (For more information see JSF 2.1 spec Appendix A 1.2.1.1 The facelets-processing element).

...