This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Omit part of the view tree

 
Anne Buit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: https://facelets.dev.java.net/nonav/docs/dev/docbook.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic