Skip to main content

Learning JSF 2

Posted by driscoll on June 17, 2009 at 6:07 PM PDT

Not too long ago, I heard someone complain that the JSF tutorial wasn't ready yet. Now, that's not surprising - the tutorial writing process (for that matter, the book writing process) doesn't actually start until the spec is more or less final, and the implementation is at least Beta (meaning feature complete).

But that raises the question: Suppose you're eager to get started. How do you learn about JSF 2 before all the user-friendly books have been written?

I suggest you go about it the way I do - here's the resources that you can use now, while waiting for the books that will come out.

Read online articles and blogs: This is probably the most obvious suggestion, if you're already here - just paging backward in this blog will get you some good information. But that really only gives you a very limited set of examples.

Read the PDL docs: Here's one that surprises me - most folks don't seem to know that every standard tag is documented in the PDL Docs. While the language of these docs can be a little overspecific and dry, of all of the standard JSF documetation, I find this the most useful.

Read the JSDocs: Not a surprising is that most folks don't realize that we have a standard set of documentation for the JavaScript API for JSF. Again, it's a bit overspecific (it's written that way, in part, because it serves as formal specs in addition to docs), but it does have a lot of good information.

There's also the JavaDocs and the Spec itself, but if often difficult to find something in there unless you know what you're looking for, so instead I recommend you...

Check out the demos: Project Mojarra has a bunch of demo programs, and many of them are really, really simple examples of things you can do with JSF 2. There's also a fair bit of cruft in there, waiting for us to clean it up, but it's probably worth your while. I recommend checking out any demo with "basic" or "ajax" in it's name, as a start. To do this, of course, you'll have to check out the Project Mojarra Source Code (check in the directory marked "jsf-demo"), but that's not such a high bar - it's not necessary to build it to get something out of the demos.

And of course, most importantly:

Ask questions: There's the mail alias, - which requires subscription, but you'll want to see other people's questions anyway. I promise you, the entire dev team reads that alias. There's the JSF Forum - where a lot of really savvy users hang out, helping each other. There's an IRC channel too, ##jsf at - where you'll often find folks from all over the JSF world.

So, to sum up, if you're a bit adventurous and ready to start right now, there's a lot of things that'll get you going. And the books will be along shortly, never fear.

Related Topics >>


It is indeed annoying that the facelets PDL docs are so buggy right now. I believe this will get fixed. In the meantime, get the JSF 2.0 refcard from dzone ( Its attribute lists are more complete than the PDL docs.

I've found that the PDL docs aren't always all that useful in that they don't seem to list all of the possible attributes that a developer might be interested in. For example, when I heard about the h:link tag and tried it, I couldn't figure out why it wasn't working. I finally came across an article that showed using outcome instead of action. This isn't explicitly listed in the PDL docs (nor is action on commandLink for that matter). Maybe that's not what the PDL docs are for, but it looks to me like a good place to document these attributes. I haven't found any good reference online for the JSF 2.0 tags. Perhaps the best is the recent refcard, but I don't think even that covers the basic attributes needed to use each tag.

It's worth mentioning that every missing attribute is a bug in the documentation. I've filed h:link missing outcome as bug #1167. I've filed the missing action attribute (and actionListener too!) as bug #1168. I urge you to file bugs as you find them - we'll fix bugs like this for our next release, which should be within a month or so. As for the JSF 2 refcard - Cay's right - it's pretty nice. Just missing the composite tags (from my quick glance). But that may be deliberate, since fitting all that on a single document is getting a little long, as the JSF tag api grows.

While I think that composite components will be used more often than you may guess, I'm at a loss as to what else you could take out to make room. I figured it was a space constraint. In other news, the PDL docs have been patched, and serveral bugs in them fixed, addressing breilly's concern. They should be public by Monday.

Jim--we fought an epic battle getting all that stuff on to the refcard. The limit is 6 sheets since they sometimes print them on card stock as conference giveaways. (I have a JSF 1 refcard that never left my desk until JSF 2 came along.) I figured that composite components are not something you need every day, so it had to go.