Nothing ventured, nothing gained

a blog by Marc Chung

A JSF Drilldown example

»

by Marc Chung

From the java and programming part of the brain.

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:

  1. Each JSF/JSP page has a backing bean stored in the request.
  2. The equivalent of a DAO class is placed in the session.
  3. 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!

Want to know more?

I'm Marc Chung, and you're reading Nothing ventured, Nothing gained, a blog about building beautiful software. I'm the founder of OpenRain Software, a web design and development company located in Arizona, where I make millions of users happy by building breathtaking software with brilliant people.

Presentations, Talks, Etc