0

Hi i have the following code

creatPage1.jsp

<h:inputText id="inputId1" value="#{createPage.item.name}"/>

i have updatePage1.jsp

<h:inputText id="inputId1" value="#{updatePage.item.name}"/>

I want to be able to do include (via ui:include or jsp:include) and be able to pass in the value dynamically (the base backing bean to be createPage or updatePage).

So the result should be

<ui:include src="Page1.jsp" basebean="#{createPage}"/>

Page1.jsp

<h:inputText id="inputId1" value="#{baseBean.item.name}"/>

Whats the best way to do this in jsf?

Chun ping Wang
  • 3,879
  • 12
  • 42
  • 53

2 Answers2

1

You can use ui:param :

<ui:include src="Page1.jsp">
  <ui:param name="basebean" value="#{createPage}"/>
</ui:include>
mrembisz
  • 12,722
  • 7
  • 36
  • 32
0

You will probably need to create your own custom tag. Check this out: http://www.ibm.com/developerworks/java/library/j-facelets/

Andre
  • 3,874
  • 3
  • 35
  • 50