gpt4 book ai didi

jsf-2 - javax.faces.FacesException : Could not resolve NavigationCase for outcome

转载 作者:行者123 更新时间:2023-12-04 03:58:01 26 4
gpt4 key购买 nike

我在/template/template.xhtml有一个template.xhtml文件

<h:head>

</h:head>

<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100">
<h:outputText value="header"></h:outputText>
</p:layoutUnit>
<p:layoutUnit position="center">
<p:layout>
<p:layoutUnit position="north">
<h:outputText value="tabs"/>
<ui:include src="/tabs/tabs.xhtml"/>
</p:layoutUnit>
<p:layoutUnit position="west">
<h:outputText value="left menu"></h:outputText>
</p:layoutUnit>
<p:layoutUnit position="center">
<h:outputText value="main-content"></h:outputText>
</p:layoutUnit>
</p:layout>
</p:layoutUnit>
<p:layoutUnit position="south" size="100">
<h:outputText value="footer"></h:outputText>
</p:layoutUnit>
</p:layout>
</h:body>
</html>

我在/tabs/tabs.xhtml中有tabs.xhtml文件
 <h:head>

</h:head>


<p:tabMenu activeIndex="#{param.i}">
<p:menuitem value="Overview" outcome="index">
<f:param name="i" value="0" />
</p:menuitem>
<p:menuitem value="Demos" outcome="index">
<f:param name="i" value="1" />
</p:menuitem>
<p:menuitem value="Documentation" outcome="index">
<f:param name="i" value="2" />
</p:menuitem>
<p:menuitem value="Support" outcome="index">
<f:param name="i" value="3" />
</p:menuitem>
<p:menuitem value="Social" outcome="index">
<f:param name="i" value="4" />
</p:menuitem>
</p:tabMenu>

由于template.xhtml中的 ui包含标记,导致出现以下异常。 ui include的src属性是否错误:
javax.faces.FacesException: Could not resolve NavigationCase for outcome: index
at org.primefaces.renderkit.OutcomeTargetRenderer.getTargetURL(OutcomeTargetRenderer.java:86)
at org.primefaces.component.menu.BaseMenuRenderer.encodeMenuItem(BaseMenuRenderer.java:162)
at org.primefaces.component.tabmenu.TabMenuRenderer.encodeItem(TabMenuRenderer.java:89)
at org.primefaces.component.tabmenu.TabMenuRenderer.encodeMarkup(TabMenuRenderer.java:65)
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:108)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83)
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:68)
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1651)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1651)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1651)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:395)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

最佳答案

ui:include标记按预期工作。问题出在tabx.xhtml内部。对于菜单项,您有outcome="index",而我的钱在index.xhtml上,与tab.xhtml不在同一文件夹中。确保结果是像../index之类的相对链接,或者确保它像/index之类的绝对链接。

为了获得更多帮助,您应该发布目录结构。

关于jsf-2 - javax.faces.FacesException : Could not resolve NavigationCase for outcome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24797670/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com