Meaningless Drivel is fun!
The moose likes JSF and the fly likes Omit part of the view tree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Omit part of the view tree" Watch "Omit part of the view tree" New topic

Omit part of the view tree

Anne Buit

Joined: Feb 21, 2009
Posts: 5

I'm developing an application using dynamic JSF. Our application has only one page, so only one view per user. This page contains everything, the dom structure is built dynamically etc. We use Java to modify, subclass and write the JSF components and their children.

However, due to the richness of our application, we are running into a bottleneck.
The serialized view itself is very small, and is stored server-sided. However, during Phase 1 of the JSF lifecycle, the entire view is restored into java objects. This results in thousands of java objects, active during the JSF Lifecycle, which might be just a few miliseconds, only to be deallocated shortly after.

Using Ajax, some phases can be skipped using attributes like 'immediate'. However, I do not know of a way to omit a part of the view. For instance, when I do a server request to perform a validation on a field, I don't need the whole application to be restored. 20.000 java objects are not an exception. 500 java objects to garbage collect instead of 20.000 would greatly improve our performance. I asked at the RichFaces forum, but to no avail.

Summary: Is there any way to limit the size of the view tree during Phase 1 of the JSF LifeCycle?
Anne Buit

Joined: Feb 21, 2009
Posts: 5
Is there anyone who has anything to say about this, or am I the only one who thinks this is an issue? Any feedback would be greatly appriciated.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Honestly said, I would share this approach under "bad design". Bad designs can only be solved by another design approach. Why only one view? Consider page includes or page fragments. Facelets may be very useful in this:
I agree. Here's the link:
subject: Omit part of the view tree
It's not a secret anymore!