错误 JSF 2.1:java.io.FileNotFoundException:*/*.xhtml 在ExternalContext 中找不到
我在 Jboss 7.0.2“Arc”、spring webflow 2.3.0.RELEASE 和 richfaces 4.0.0.Final(Myfaces 2.1.1) 中出现错误:
12:34:19,729 严重 [org.apache.myfaces.renderkit.ErrorPageWriter] (http--127.0.0.1-8080-2) 发生异常:javax.faces.FacesException:java.io.FileNotFoundException:/sections在ExternalContext 中未找到/login/header.xhtml 作为资源。
当我运行我的login.xhtml页面时:
<ui:composition template="/WEB-INF/flows/template/default.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<ui:define name="windowTitle">
#{msgs.loginTitle}
</ui:define>
<ui:define name="heading">
<ui:include src="/sections/login/header.xhtml"/>
</ui:define>
<ui:define name="sidebarLeft">
<ui:include src="/sections/login/sidebarLeft.xhtml"/>
</ui:define>
<ui:define name="content">
<h:form>
<h:panelGrid columns="2">
#{msgs.namePrompt}
<h:inputText id="name" value="#{user.name}"/>
#{msgs.passwordPrompt}
<h:inputSecret id="password" value="#{user.password}"/>
</h:panelGrid>
<p>
<h:commandButton value="#{msgs.loginButtonText}"
action="planetarium"/>
</p>
</h:form>
</ui:define>
header.xhtml的代码是:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<!-- <head><title>IGNORED</title></head> -->
<body>
<ui:composition>
<div class="header">
#{msgs.loginHeading}
</div>
</ui:composition>
</body>
</html>
结构文件是这样的:
WEB-INF/flows/inscripcion
inscripcion-flow.xhtml
inscripcion.xhtml
login.xhtml
WEB-INF/flows/sections/login
header.xhtml
sidebarLeft.xhtml
WEB-INF/flows/template
template.xhtml
为什么会出现这个错误?,我附上了我的Jboss提示
I have an a error in Jboss 7.0.2 "Arc", spring webflow 2.3.0.RELEASE with richfaces 4.0.0.Final(Myfaces 2.1.1):
12:34:19,729 SEVERE [org.apache.myfaces.renderkit.ErrorPageWriter] (http--127.0.0.1-8080-2) An exception occurred: javax.faces.FacesException: java.io.FileNotFoundException: /sections/login/header.xhtml Not Found in ExternalContext as a Resource.
when i run my login.xhtml page:
<ui:composition template="/WEB-INF/flows/template/default.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<ui:define name="windowTitle">
#{msgs.loginTitle}
</ui:define>
<ui:define name="heading">
<ui:include src="/sections/login/header.xhtml"/>
</ui:define>
<ui:define name="sidebarLeft">
<ui:include src="/sections/login/sidebarLeft.xhtml"/>
</ui:define>
<ui:define name="content">
<h:form>
<h:panelGrid columns="2">
#{msgs.namePrompt}
<h:inputText id="name" value="#{user.name}"/>
#{msgs.passwordPrompt}
<h:inputSecret id="password" value="#{user.password}"/>
</h:panelGrid>
<p>
<h:commandButton value="#{msgs.loginButtonText}"
action="planetarium"/>
</p>
</h:form>
</ui:define>
The code of header.xhtml is:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<!-- <head><title>IGNORED</title></head> -->
<body>
<ui:composition>
<div class="header">
#{msgs.loginHeading}
</div>
</ui:composition>
</body>
</html>
the structure file is like this:
WEB-INF/flows/inscripcion
inscripcion-flow.xhtml
inscripcion.xhtml
login.xhtml
WEB-INF/flows/sections/login
header.xhtml
sidebarLeft.xhtml
WEB-INF/flows/template
template.xhtml
Why is this error?, I attached my Jboss Prompt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎已将其放置在 WEB-INF/flows/sections/login/header.xhtml 中。相应地修复
src
以匹配此内容。You seem to have placed it in
WEB-INF/flows/sections/login/header.xhtml
. Fix thesrc
accordingly to match this.