1

Is it possible to use tiles in JSF2.0?
I am planning for migration of MyFaces1.1 with tomahawk JSP tiles view handler into JSF2.0. Facelets is the default view handler in JSF2, is it possible to use tiles as view handler in JSF2?

user1020455
  • 176
  • 2
  • 13

1 Answers1

0

Tiles is not a view technology. It's just a JSP taglib which simplifies templating of JSP pages like as JSP's successor Facelets mostly already by default supports out the box with <ui:xxx> tags. JSP is a view technology. JSF 2.x has already a builtin view handler for JSP.

Facelets is not the same as JSP. Facelets is a completely distinct view technology, it is XML based and it does not support legacy JSP taglibs such as Tiles. It supports Facelets taglibs only. Tiles does not offer a taglib for Facelets. As Tiles is not a view technology, you cannot use a (custom) view handler for Tiles. You need to use the standard view handler for JSP files.

You have basically 2 options:

  1. Stick to using JSP. Yes, JSP is still supported in JSF 2.x, it's just not the default view technology anymore. When you have a view in both JSP and Facelets format, the Facelets one will get precedence. You can mix distinct JSP and Facelets pages in the same webapp without problems.

  2. Migrate all JSPs with Tiles to Facelets.

See also:

Community
  • 1
  • 1
BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452