• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I need a conceptual understanding of the JavaServer Faces framework.

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a JavaServer Faces newbie trying to get my head around this framework by using whatever online tutorials and resources I can find. So far the hunt has not been overly successful. I've been studying the java language at home on my own from a small application and desktop perspective.

I've found some tutorials targeted at the JSF framework but most of them are old or are very task specific, like how to create a data table in Eclipse or build contact form in Netbeans, but I find little to nothing that thoroughly addresses JSF conceptually. I've been trying to fill in that picture in my head by downloading various libraries and pulling through the sources and reading the spec manuals that are available, but that hasn't been overly helpful either.

I've looked at Icefaces, Richfaces, Primefaces, Myfaces and Mojarra and although I see similarities there are enough distinct differences that it really makes me wonder how Java Server Faces are supposed to work. For example, Icefaces is large and uses java code on the server to create it's pages and components while Primefaces is small and uses alot of javascript to create components on the client side and what is Mojarra? Is Mojarra the code base of the JEE6 library packages that give us javax.faces, javax.faces.application, javax.faces.bean...etc? In the end it compiles down to jsf-api.jar and jsf-impl.jar?

As you can see, I am confused, and what it'd really like to see is a couple of tutorials that clearly explain the conceptual framework of the JSF library and how it plugs together and interacts. I've been trying to read the JavaServer Faces Specification 2.0 but it's written in some sort of extremely tedious legalistic techno speak that has me utterly confused about what a value expression is now. I mean I used to think I knew, but not any more.

Can any one point me to some articles that might help clear this fog?
 
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Donald Jackson wrote:
I've looked at Icefaces, Richfaces, Primefaces, Myfaces and Mojarra and although I see similarities there are enough distinct differences that it really makes me wonder how Java Server Faces are supposed to work. For example, Icefaces is large and uses java code on the server to create it's pages and components while Primefaces is small and uses alot of javascript to create components on the client side and what is Mojarra? Is Mojarra the code base of the JEE6 library packages that give us javax.faces, javax.faces.application, javax.faces.bean...etc? In the end it compiles down to jsf-api.jar and jsf-impl.jar?


ICEfaces, Richfaces, Primefaces and Mojarra scales (as well as some others) are component libraries (they add to the default set of components you can use, and are all pretty much about adding AJAX to the components). Mojarra is the Reference Implementation for JSF, Apache MyFaces is another JSF implementation (you have to have one or the other, and typically you'll see Mojarra in use). They will be your jsf-api.jar and jsf-impl.jar, you'll have to have these to use JSF.

Donald Jackson wrote:
Can any one point me to some articles that might help clear this fog?



Here are a few places to start:
  • http://www.javaserverfaces.org/get-started
  • http://java.sun.com/javaee/6/docs/tutorial/doc/bnaph.html -- Which is the new JSF 2.0 stuff
  • http://java.sun.com/javaee/5/docs/tutorial/doc/bnaph.html -- Which is the older 1.2 stuff, but actually seems more complete (odd), this should give you a pretty good idea of how things work together


  • Hope that helps.
     
    Ranch Hand
    Posts: 201
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I like this question and I appreciate the answer, as I have similar questions.
     
    Donald Jackson
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    So basically, ICEfaces and Primefaces are component libraries that are built on top of and make calls into Mojarra. Mojarra is the base functionality of JavaServer Faces in the JEE6 libraries? Ok, that does make sense...it's what I suspected. I guess one of the issues that seems to confuse me while trying to figure out JSF is if you pull through the code files of ICEfaces and then pull through Primefaces the two libraries look so different it's hard to imagine that they do the same things and are calling into the same base libraries.

    So leaves me with pulling through Mojarra piece by piece and saying "the foot-bone's connected to the ankle-bone" if you get my drift. The page markup calls into the servlet, that updates the doodads that locate the ELresolver that decodes the artifact that calls the backing bean that hydrates the entities...etc. Yes, I know, probably more convoluted and simplistic than the way you're used to thinking about programming, but unfortunately, that's how my mind works. I know there isn't always a linear one to one relationship between cause and effect but my thick browed habits are such that I always look for it.

    I guess I'll just keep digging until I can draw the picture on my cave wall.
     
    Greenhorn
    Posts: 24
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    It sounds like you're looking for a very technical explanation of how JSF works, and if that's the case, the best place to read is the JSF Specification itself.

    You can find it here in PDF format, here
     
    Donald Jackson
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I am reading it. Unfortunately, the more I read it, the dumber I get. I used to know what a value expression was until I read the JSF Specification, now I realize that I don't have a clue.
     
    Donald Jackson
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Here's an example of what I'm talking about:

    From the JSF Spec section 3.1.4-

    "Properties and attributes of standard concrete component classes may be value expression enabled. This means that,
    rather than specifying a literal value as the parameter to a property or attribute setter, the caller instead associates a
    ValueExpression (see Section 5.8.3 “ValueBinding”) whose getValue() method must be called (by the property
    getter) to return the actual property value to be returned if no value has been set via the corresponding property setter. If
    a property or attribute value has been set, that value must be returned by the property getter (shadowing any associated
    value binding expression for this property)"

    As you can see, this paragraph in the specification refers me to section 5.8.3 to help clarify what's going on here.
    Well, section 5.8.3 illuminates us further by sending us on to section 7.9.3, which of course references back to section 7.1.10.

    Now I don't mean to be dense and I apologize because I'm quite sure that I'm probably in over my head and shouldn't even be here,
    but I know there has to be a simpler way to explain this.

    Would some kind soul like to take a shot? I'd be most greatful.
     
    Bill Johnston
    Ranch Hand
    Posts: 201
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I don't mean - or desire - to "pollute" this thread (topic), but I will just say that I sympathize with you. For example, my initial introduction to Java Generics had me reading sentence structures that I wasn't able to understand even if I knew already how Generics worked, much less that I didn't . I later found material that was more, let's say, understandable - though I still don't like (no, I actually hate) Generics. Let's face it - technical writing, as with ANY writing - is difficult to do well; those that manage it are to be appreciated.
     
    Donald Jackson
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Well Bill, I don't think a little pollution would hurt matters. I'm probably over reaching my grasp here trying to understand JavaServer Faces <grok it's fullness>, but I've never learned anything unless I was over reaching. And I really would like to have this value expression [ValueExpression] business explained to me...I wasn't just using it as an example of my frustration with reading the JSF Specs. I'm sure that making it dense and legalistic is some kind of requirement for specifications as I have not seen one that wasn't written in that manner, but I can't say that I see it as being useful for anything other than making sure that only a precious few can actually understand it.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic