• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Performance of a JSF page

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a jsf page which has several tabs and we make use of IBM tags. The current IBM code sends all the tabs across, even if they are never accessed. The jsp pages that are included in the subviews inturn access backend procedure where the business logic of the screen resides. This is making the screen to load very slowly and becoming a pain.

Is there any way i can load the subview only upon clicking that tab.




Can anybody advice if there is any other way that i can improve the performance of the screen.

Thank you!
 
Saloon Keeper
Posts: 28424
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing that comes to mind is AJAX. If you defer loading the tab contents until you actually need them, you can speed things up because you don't load what you don't need. Of course the penalty is that the first display of the tab will be delayed while it loads.

You say you're using "IBM" tags, but these are standard JSF core elements you're using here, except for the "jsp:" elements, which are JSTL (and probably shouldn't have been used - use the Facelets ui:include instead).

To get the tab contents to load via AJAX would require one of the following:

1. Manual AJAX javascript coding (JSF 1.1, JSF 1.2)

2. The AJAX support tags in JSF 2

3. An AJAX-friendly tab control such as the one that comes with JBoss RichFaces.

Of the 3, I do recommend that you use an extension tagset that actually supports tabs (option 3), if it's permitted. It's a lot easier to code and maintain.
 
Padma Priya
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

The option 1 given by you seems to be a feasible solution for me.

But i am not sure how to code ajax.



The tabs are coded as shown above. We are making use of IBM tabs.

The attempt is to have Tab contents rendered as Ajax enabled.
1) Initially,When the screenloads,Tab1 will only be retrieving Data to be rendered.
2) When the user clicks on Tab2, then "on click" of Tab2, the data for Tab2 should be loaded.
3)If i click Tab1 again, it should refresh only Tab1.

Also going through several forums online they suggested that since bfPanel tags don't support behaviors, so we have to Add a hidden button that can be clicked to the page for each ajax call that we make. That makes sense but i am not sure how to code it as i am new in JSF. Can you give me a code snippet that i can follow

Thank you!
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic