こんにちは、<ui:include>
タグに問題があります。ページを別のページに含めようとすると、
javax.faces.view.facelets.TagAttributeException: /index.xhtml @27,51 <ui:include src="index_core/naglowek.xhtml"> Invalid path : index_core/naglowek.xhtml
com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:125)
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164)
com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:902)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
org.openfaces.util.ResourceFilter.doFilter(ResourceFilter.java:41)
このページの例を使用すると、すべて正常に動作するため、これは奇妙です。
<?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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:o="http://openfaces.org/">
<h:head>
<title>PIR Kreator Ofert</title>
<script src="/WEB-INF/resources/script.js" type="text/javascript"></script>
</h:head>
<h:body>
<h:form id="form">
<!-- EDIT TITLE -->
<o:tabbedPane>
<o:subPanel caption="Nagłówek">
<ui:include src="index_core/naglowek.xhtml"/>
</o:subPanel>
<o:subPanel caption="Produkty">
<ui:include src="index_core/produkty.xhtml" />
</o:subPanel>
<!-- INSTALACJA TAB -->
<o:subPanel caption="Montaz">
<ui:include src="index_core/montaz.xhtml" />
</o:subPanel>
<!-- PANEL USLUGI -->
<o:subPanel caption="Usługi">
<ui:include src="index_core/uslugi.xhtml" />
</o:subPanel>
</o:tabbedPane>
<o:commandButton id="printButton" value="Drukuj"
actionListener="#{pdf.printt}" />
<!-- AJAX -->
<o:ajax id="selectService" standalone="true"
execute=":form:serviceTable" render=":form:selectedServiceTable" />
<o:ajax id="selectAsm" standalone="true" execute=":form:assemblyTable"
render=":form:selectedAsmTable" />
<o:ajax id="setTitleDesc" standalone="true"
execute=":form:opisArea :form:titleText" />
<o:ajax id="printProduct" standalone="true"
execute=":form:resultTablePanel" />
<o:ajax id="addProduct" standalone="true"
render=":form:resultTablePanel" execute=":form:produktMenu" />
</h:form>
</h:body>
</html>
および naglowek.xhtml ソース:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:o="http://openfaces.org/">
<h:outputLabel id="dodajTytulCheckbox" />
<h4>Edytuj tytuł:</h4>
<o:selectBooleanCheckbox id="addTitleC" value="#{ajaxBean.editTitle}">
<o:ajax event="click" render="titleText" />
</o:selectBooleanCheckbox>
<o:inputText id="titleText" value="#{pdf.title}"
disabled="#{not ajaxBean.editTitle}" />
<br />
<!-- EDIT OPIS -->
<h:outputLabel id="dodajOpisCheckbox" value="Opis" />
<o:selectBooleanCheckbox id="addOpisC" value="#{ajaxBean.opis}">
<o:ajax event="click" render=":form:opisArea" />
</o:selectBooleanCheckbox>
<h:panelGroup id="opisArea">
<o:inputTextarea value="#{pdf.opis}" disabled="#{not ajaxBean.opis}" />
</h:panelGroup>
<br />
<h:commandButton value="Ustaw" type="button"
onclick="O$('form:setTitleDesc').run()" />
</ui:composition>
パスを指定するなど、さまざまな方法を使用しました/index_core/naglowek.xhtml
index_core/naglowek.xhtml
。Eclipse自体がヒントを提供し、naglowek.xhtml
Ctrlを押しながら名前をクリックすると、正しくページに移動します
それを修正する方法は?ライブラリ OpenFaces の使用が原因でしょうか?