Check out Duncan Mills example of a drilldown pattern using JSF. It’s illustrated with a simple user interface that displays the index page, and provides links to a page where details can be changed. I just wanted to point out some good JSF practices. If you take a look at the the faces-config.xml:
- Each JSF/JSP page has a backing bean stored in the request.
- The equivalent of a DAO class is placed in the session.
- An instance of the object type being modified is also loaded as backing bean.
Letting JSF handle these objects allows them to be acquired through the JSF framework. Also, the tabular and edit backing beans end up being simpler to write, and result in fewer objects being created per JSF session. My only beef with this example is that
String action() methods are usually meant for returning the next path in the workflow, and should not be doing work. Instead, work should be placed in
void actionListener(ActionEvent ae) methods.
It’s a pretty good post. Developers new to JSF should give it a quick read.
Update: It appears this article is the number one hit on Google for the terms “JSF GET” Neat!