【问题标题】:How do I dynamically include the backing bean value in jsf 1.2如何在 jsf 1.2 中动态包含支持 bean 值
【发布时间】:2012-02-21 22:24:30
【问题描述】:

您好,我有以下代码

creatPage1.jsp

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

我有 updatePage1.jsp

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

我希望能够包含(通过 ui:include 或 jsp:include)并能够动态地传递值(基础支持 bean 是 createPage 或 updatePage)。

所以结果应该是

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

Page1.jsp

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

在 jsf 中最好的方法是什么?

【问题讨论】:

    标签: jsf tomahawk jspinclude backing-beans


    【解决方案1】:

    你可以使用ui:param

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

    【讨论】:

      【解决方案2】:

      您可能需要创建自己的自定义标签。看看这个:http://www.ibm.com/developerworks/java/library/j-facelets/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-11-15
        • 1970-01-01
        • 2012-03-15
        • 1970-01-01
        • 2013-05-07
        • 2012-01-30
        • 2014-03-10
        • 1970-01-01
        相关资源
        最近更新 更多