开发者

JSF ui:include downside

I have this web applicati开发者_运维知识库on and one of the module use an excessive amount of ui:include.

ex.

page 1.0 include --> page1.1 include page 2.0 include --> page 2.1

page 1.0 include --> page1.2 include page 3.0 include --> page 3.1

page 1.0 include --> page1.3 include page 4.0 include --> page 4.1

and so on..

so in short the landing page of that module has 16 ui:include and almost every ui:include has a another ui:include in it (up to 3 layers).

Now my question is, are there any known performance issue using to much ui:include?

Thanks,


My guess is it has the same performance as just taking all the pages and putting them all together into one page. Since that's what an include does, if you have a page you repeat in other pages, then its just easyer to make one page and include it in the others.

The include just makes the pages easyer to configure and look at i guess


If some included components are only shown conditionally, then wrap them in an outputPanel with a rendered attribute that is tied with their display. Something like the following for each include that is conditionally viewed.

<a4j:outputPanel rendered="#{myBean.showInclude2}">
    <ui:include src="page2.0.xhtml" />
</a4j:outputPanel>

Assumptions about not all components being needed based on comments in Rafael's answer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜