Before Craig mentions it, you might want to have a look at the Apache
Shale "View Controller" library:
http://shale.apache.org/
This provides "page load events".
The JBoss Seam library also provides this functionality.
However, as Mike says, your current approach will also work.
Regards,
Simon
Mike Kienenberger wrote:
It'll depend on your specific situation, but the methodology below
works fine. I've used this structure myself.
On 12/7/06, Naresh Bhatia <[EMAIL PROTECTED]> wrote:
I have a bean property that is displayed on a page. The value of the
property needs to be initialized by making a service layer call. When
should this initialization be done? Currently I am doing a lazy
initialization when the property is first accessed:
public class ForumDetailsBean {
private ForumDetailsVO forum;
public ForumDetailsVO getForum() {
if (forum == null) {
forum = forumService.getForumDetails(forumId);
}
return forum;
}
public void setForum(ForumDetailsVO forum) {
this.forum = forum;
}
}
In other component frameworks I have used (e.g. asp.net), such
initialization is done on page load events. What is the recommended JSF
way? (BTW, my bean is in request scope).
Naresh