用于更新ui的JSF Bookmarkable URL:装饰值

时间:2014-07-28 06:50:10

标签: jsf-2 primefaces facelets myfaces

需要帮助。我试图让我当前的项目可收藏。我的当前设计基本上可以在这段代码中总结出来:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <f:metadata>
        <f:viewParam name="contentUrl" value="#{navigationBean.contentUrl}"/>
    </f:metadata>
    <h:body>

        <ui:composition template="/views/template/template.xhtml">

            <ui:define name="leftpane">
                <ui:include src="/views/admin/menu_administrator.xhtml"/>
            </ui:define>

            <ui:define name="rightpane">
                <p:growl showDetail="true" sticky="false" />
                <ui:decorate template="/views/admin/content/#{navigationBean.contentUrl}.xhtml"/>
            </ui:define>

        </ui:composition>

    </h:body>

</html>

所以我有这个模板让网站30/70看起来有&#34; leftpane&#34;包含菜单和&#34;右窗格&#34;显示输出内容。我想要的是能够改变&#34;右边界&#34;取决于发送的URL:

www.mysite.com/projectitle/views/admin/Administrator.xhtml?faces-redirect=true&amp;contentUrl=cont_admin_rapptmnttype

将在此网址中构建的内容:/views/admin/content/#{navigationBean.contentUrl}.xhtml在&#34;右窗格&#34;还有一个相应的支持bean来生成所需的输出

我使用的是Primefaces3.5,MyFaces2.0,WAS8.5

希望有人可以帮我解决这个问题。感谢。

更新

我正在使用p:menuitem设置contentUrl,如

<p:menuitem value="Appointment Type" id="cont_admin_rapptmnttype"
                                ajax="false" outcome="#{navigationBean.currentMode}" >
                                <f:param name="contentUrl" value="cont_admin_rapptmnttype"/>
</p:menuitem>

但是当我点击menuitem时,我得到一个Stackoverflow异常,当它转过来时,是由以下原因造成的:

<ui:decorate template="/views/admin/content/#{navigationBean.contentUrl}.xhtml"/>

我试图更新的是哪一个。

以下是stacktrace中的重复异常:

at org.apache.myfaces.view.facelets.tag.ui.DecorateHandler.apply(DecorateHandler.java:137)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:59)
    at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:324)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:54)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:59)
    at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:324)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:54)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
    at org.apache.myfaces.view.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:150)
    at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57)
    at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:45)
    at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:322)
    at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:369)
    at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:347)
    at org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:215)

0 个答案:

没有答案