What's the best way of templating a JSF website?

I'm developing a web application and I would like all the pages to have a common look and feel. Having the menus on the left side, the title of the website on top and a toolbar below the title and then the content of the page would be on what it is left of the page.

In ASP.NET this was done using Master Pages, but this doesn't seem to exist on JSF.

I've read about the jsp include tag and it looks similar to asp.net user controls which were used on framework 1.1 before the master page were developed to template pages. However, I have not looked too much at them to be sure about this.

I have also heard about facelets and tiles, which are supposed to be better than jsp include, although more complex. Which advantages do they have over jsp:include? How hard are they to implement? I'm using eclipse 3.2 (hopefully 3.3 soon since their support for JSF will be better =) ), so I may not have the right wizard for those two.

Thanks,

PS: I've not found an official forum on the Eclipse webpage, and I have a doubt regarding the IDE, is there a way to fold the code like you do in visual studio using #region #endregion? I would like to fold all the getters and setters in just one region of code fold.

[1245 byte] By [magoicocheaa] at [2007-11-27 6:05:14]
# 1

I'm a fairly new JSF developer (about 1 year); however, it only took me a few hours to start using Facelets. In a few weeks, Facelets was a breeze.

Templating with Facelets will take you 2 hours to learn. Just read the excellent developers documentation on the Facelets web site. It also eliminates the need for JSP, along with some of the complexities of JSP. Also, templating is just one part of Facelets. Among others, it gives you the capability of easily creating custom components using "composition", which is basically a method of combining several RI components into one custom component. You can even create your pages in XHTML and use a simple "jsfc" attribute in normal HTML tags. Facelets will compile the HTML tags into their corresponding JSF tags!

I've looked at, and used, includes, Facelets, and Struts Tiles. Although Tiles has it's strong points, there is nothing better than Facelets for JSF in my opionion (and many others).

The downside to Facelets is there is still limited, or no support for it in some IDEs. Namely, Java Studio Creator does not support Facelets (that's the ONLY reason why I don't use JSC). Development of new Facelets features/versions seems to slowed down lately, but I believe the creator (Jacob Hookom ?) has plans for a bright Facelets future (not sure there).

Exadel Studio Pro is an excellent, (soon to be) open source Eclipse-based IDE that provides excellent support for Facelets. You can download it free from JBoss.com. It will be renamed to Red Hat Studio sometime near the end of this summer. Checkout JBoss Seam while you're on the JBoss site. ;-)

There is also a new jsf-templating project (https://jsftemplating.dev.java.net/). I know very little about it, but it might be worth checking out.

Tom

Good luck!

Tom

tptackaba at 2007-7-12 16:50:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...