Jsf 在XHTML中使用IFrame时FacesFileNotFoundException

Jsf 在XHTML中使用IFrame时FacesFileNotFoundException,jsf,iframe,Jsf,Iframe,在第二个浏览器中使用IFRAME菜单栏时,我收到com.sun.faces.context.FacesFileNotFoundException 我在使用其他浏览器时遇到此错误 HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. - exc

在第二个浏览器中使用IFRAME菜单栏时,我收到com.sun.faces.context.FacesFileNotFoundException

我在使用其他浏览器时遇到此错误

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.
-

exception

com.sun.faces.context.FacesFileNotFoundException: /xhtml/auth/faces/xhtml/client/clientImage.xhtml Not Found in ExternalContext as a Resource
    com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)
    com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)
    com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)
    com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)
    com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:233)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    com.beo.importexport.filter.AuthFilter.doFilter(AuthFilter.java:64)
    org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
note The full stack trace of the root cause is available in the JBoss Web/7.0.13.Final logs.

JBoss Web/7.0.13.Final:
我在一个XHTML页面中使用了一个模板。 在该模板中使用了一个IFrame

iframe由带有一些菜单项的菜单栏组成

我的问题是,当登录到第二个web浏览器时,会话被更改,因此IFRAME中的SRC将旧路径作为硬记录路径的前缀

下面是我的iframe src标记

     <iframe name="contentframe"   id="contentframe"  
            width="100%" height="710px"  
    src="faces/xhtml/client/clientImage.xhtml" 
            scrolling="auto"   
           style="overflow: auto;" >
     </iframe>

为什么这个路径前缀出现在SRC IFRAME中?

这是因为您的
表示一个相对URL。它不以方案开头(例如
http://
https://
等),也不以斜杠(
/
)开头。相对URL是相对于当前请求URL进行解释的(浏览器地址栏中显示的URL;注意:因此,与服务器磁盘文件系统中的物理文件位置无关,因为许多启动器错误地认为!)

因此,如果请求URL是(猜测
/faces
是上下文路径;您对此不清楚,您没有告诉任何关于上下文路径、实际请求URL或JSF映射的信息),例如

然后,将在当前请求URL的同一文件夹中搜索相对URL
faces/xhtml/client/clientImage.xhtml
,得到以下URL:

在仍然分析
/faces
是上下文路径的同时,这将产生您得到的异常:

com.sun.faces.context.FacesFileNotFoundException: /xhtml/auth/faces/xhtml/client/clientImage.xhtml Not Found in ExternalContext as a Resource
您还不清楚iframe文件的URL。根据目前为止提供的信息,我最好的猜测是

如果这是真的,那么您应该实际使用

<iframe src="/faces/xhtml/client/clientImage.xhtml" />


前导斜杠
/
将使其相对于域根进行解释,而不考虑当前的请求URL。

谢谢BalusC,但我通过这样放置路径得到了解决方案-@TitusKurian Hello。我面临着类似的问题;您是以某种方式在托管bean中定义
request
,还是它是某种EL表达式?请发表评论?