This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I seem to be confused when it comes to form population. I try very hard to limit the amount of session beans I use to storing user login information, etc. For the most part, I prefer to use client-side viewstate over session beans. I know there are cases where the latter is necessary. Now for my dilemma, I still dont see how to populate a bean tied to a particular view using the viewstate scenario. As an example, suppose I have a page that has a datagrid where a user can click a link which is connected to an id field of a table on the backend database, which will then take the user to a page where they can get detailed information about the particular record they selected from the previous page. I know that backing beans also hold the actions to be performed for button click, link clicks, etc. but this seems to be a different kind of interaction because it spans across two different pages. To me, it seems like the backing bean would have to somehow receive the id of the particular record and populate itself, as oppose to the previous page being responsible for this. Once again, I would like to limit the amount of session beans I use. Where should this loading of the backing bean take place and how does this affect the view? Any examples and explanations would be greatly appreciated?