I think I might have figured something out about JSF (JavaServer Faces) last night. (Yes, I hate to admit it, but I even think about programming when having fitful sleep…)
With Struts (Edit: Struts 1), you write your code to present everything that’s necessary to the JSP page, almost like you have to use JSP to pull the info out of the model.
But, I think, in JSF you just set up your model to do what you need to do, and the JSP (or Facelets, or whatever) allows you to present it.
It seems to be kind of a philosophical difference between pulling data (in Struts), or letting the data out that wants out (in JSF)… Yeah, this could be all wrong, but it could also be the key to why my little experiments with JSF had me completely frustrated.
A little background: I went to NFJS, and 3 out of the 9 sessions I went to dealt with JSF. I came back really excited, and started trying to play with it.
I couldn’t figure out how to go from a list of summary lines to link to an edit page of one of the single items. The brain wasn’t workin’ or something… I couldn’t get links to go from the summary page to the edit pages… But, I think that’s ‘cuz I was approaching it from a Struts mentality. Maybe I’ll try my little test scenario again in the coming weeks, this time with the newer understanding… (In the meantime, I might try to find some more documentation or an example JSF app that I can analyze for my new pattern.)