Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF -- Best way to learn?  RSS feed

Mike D Smith
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a java newbie, having spent most of my time writing C# code. I've been dumped in a project that will be using PrimeFaces. Since I don't really know Java, nor JEE, nor JSP/JSF, or PrimeFaces, I am hoping someone can give me some suggestions on how to quickly (if that's even possible) come up to speed on JSF and Primefaces. I know, not the smartest move by my organization to ask a .Net developer to jump in and contribute to a Primefaces project, but that's where I find myself unfortunately. Could really use some suggestions as I'm pulling my hair out trying to make sense of all this stuff.

Tim Holloway
Posts: 18662
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a pretty tall order. You're attempting to switch languages and frameworks all at once.

I can give some basic info, but it's just a scratch.

1. JSF is a fairly strict implementation of the Model/View/Controller paradigm. You define the Models (Backing Beans) and the Views (xhtml), and the Controllers are pre-supplied by JSF itself.

2. The normal mode of operation of JSF is to
A. present (render) a View using values obtained from its Model(s).
B. accept a form submission from that View
C. validate the inputs from that form
D. Update the Model from the form
E. Invoke the form submit action method to act on the updated Model and possibly update the Model further in anticipation of new View rendering.
F. Navigate to whatever View the action method wishes.
G. repeat from A

Steps D-F are bypassed if any of the form values are invalid. For actual details, consult the docs on the "JSF Lifecycle".

3. I consider a good start for learning how to do common JSF functions to be Rick Hightower's IBM Developerworks series "JSF for Non-Believers". Use your web search engine to locate it.

4. JSF is designed to make Simple Things Simple and Complex Things Possible. It is based on the Plain Old Java Object (POJO JavaBean) concept. If you find yourself writing code that digs into javax.faces classes other than the model classes (DataModel and SelectItem), you are probably doing it wrong. Nothing screams "n00b!" louder than a lot of platform-specific JSF code. The less a JSF code module looks like "JSF", the more JSF it's likely to be (how's that for Zen?)
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!