2

I have a JSF page that is included in other JSF pages (basically a page header, with common information). This common page has its own controller and is reliant that the page which includes this common page pass it some common data.

Specifically, I am currently trying to include this common page on other pages using:

<ui:include src="commonPage.xhtml">
   <ui:param name="commonData" value="#{thisPagesController.commonData}"/>
</ui:include>   

Which should pass "commonData" to the commonPage.xhtml page and ideally set the "commonData" property on the CommonPageController class:

@ManagedProperty("#{commonData}")
CommonData commonData;

However, this is not working... the managed property is not getting set.

What is the proper way to do this?

BestPractices
  • 12,738
  • 29
  • 96
  • 140
  • 1
    There is no standard JSF API way for this. This is after all implementation specific. Consider a custom component or a composite component. – BalusC Jul 05 '12 at 19:39

1 Answers1

1

See comment from BalusC. There is no standard for this in the JSF API spec. Use a composite or custom component instead.

BestPractices
  • 12,738
  • 29
  • 96
  • 140