Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF Rendering & Performance

982080Dec 28 2012 — edited Dec 29 2012
Hi,

I am using the below code snippet to render my pages based on certain conditions

<h:form>
<ui:fragment rendered="#{mybean.pageName eq 'CourseType'}">
<ui:include src="/pages/courseTypePage.xhtml />
<ui:fragment>
<ui:fragment rendered="#{mybean.pageName eq 'ContainerType'}">
<ui:include src="/pages/containerTypePage.xhtml />
<ui:fragment>
<ui:fragment rendered="#{mybean.pageName eq 'MenuType'}">
<ui:include src="/pages/menuTypePage.xhtml />
<ui:fragment>
..........................................................
..........................................................
</h:form>

I have many pages like this. I wanted to know,

1. If I use rendered attribute like this, is it a performance hit.Because even if only 1 page is getting rendered, I found it is validating all the pages I have included here when loading the above page. If any invalid code or duplicate id in any of the pages above with rendered attribute value evaluated to false is giving me error.
2. In the DOM tree, all the pages and its components will be there?

I tried to build the pageUrl dynamically. but because of some other issues, it is not working fine.

Can anyone give some light on this. If there is a better approach, could you please suggest.

Any help will be greatly appreciated.

Thanks,
Sreejith
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 26 2013
Added on Dec 28 2012
7 comments
1,987 views