views:

300

answers:

3

I've been working with JSF for some time, and been using the Apache-Trinidad tags. I like developing using this a lot but I keep hearing great things about facelets. Is anyone out there using it, and what exactly does it get you?

I've looked at the facelets site (https://facelets.dev.java.net/), but it doesn't do a very good job explaining the advantages or any tutorials about facelets. I looked on google, but everything seems to be from 2005 or 2006, surely there's been a lot of changes since then.

Anyone want to chime in with their opinion of facelets or point me to some good resources?

+1  A: 

Facelets haven't really changed. It's a very simple templating engine that runs as a JSF view handler and replaces jsp.

The old resources are still valid.

  • Uses xml for templates.
  • You can use EL anywhere.
  • Very few tags.
  • Very simple
  • ...

In my humble opinion, it is a much better approach to create the interface than JSPs.

Loki
+1  A: 

It's really a great thing about facelets. They did it right the first time, so I guess theree has been no need to upgrade it. Also seems like something like facelets is making it's way into the JSF 2.0 spec. (http://jcp.org/en/jsr/detail?id=314)

At one of the places I work, I've just converted a project from JSF 1.1 to JSF 1.2 with facelets, and I really like it. What I got from it was:

  • Templating (no need for tiles)
  • Better debugging (debug views instead of just stack traces)
  • ui:repeat and c:if etc
  • Can use html intermixed with tags, allowing me to use a plain html table with colspans without no extra taglib if thats what I want.
  • syntax almost same as jsp, so it's easy to convert pages.
  • rolling your own components is now really simple.

As for resources, I guess the old ones are still valid.

Erik Itland
A: 

I've just started working with facelets as well, and so far the best resource I've found is the book "The Definitive Guide to Apache MyFaces and Facelets" from Apress. While it's likely you won't need the other chapters, since you've worked with Trinadad tags already, I've found the examples they use to explain facelets give a good concrete foundation. I'm constantly refering to the text to pull out bits of code.

PS Here's the link from Google Books, it'll at least give you a taste of what's inside.

Alex Larzelere