2017-06-27 12 views
0

由于某种原因,image etf.jpg不会显示,我真的认为它与URL无关。当我按住并点击NetBeans中的图像时,它显示图片就好了。它与插入标签有什么关系?在JSF模板中没有显示html图片

!This is file organisation of the project 1

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:h="http://xmlns.jcp.org/jsf/html" 
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets" 
    xmlns:p="http://primefaces.org/ui"> 
<h:head> 
    <title>Facelet Title</title> 
</h:head> 
<style> 
    div1{ 
     position: absolute; 
     background-color: lightblue; 
     font-family: arial; 
     font-size: 75px; 
     text-align: center; 
     top: 0px; 
     font-weight: bold; 
     left: 0%; 
     width: 100%; 
     height: 17%; 
     color: lightslategray; 
    } 
    div2{ 
     position: absolute; 
     top: 20%; 
     font-family: arial; 
    } 
    div3{ 
     background-color: red; 
     font-family: arial; 
     position: absolute; 
     bottom: 0%; 
     width: 100%; 
     left: 0%; 
     font-style: italic; 
     font-weight: lighter; 
     height: 15%; 
     color: lightslategray; 
     text-align: right; 
    } 

</style> 
<h:body> 
    <div1> 
     <ui:insert name="header"> 
      <ui:include src = "header.xhtml"/> 
     </ui:insert> 
    </div1> 
    <div2> 
     <ui:insert name="content"> 
      <ui:include src ="defaultContent.xhtml"/> 
     </ui:insert> 
    </div2> 
    <div3> 

     <ui:insert name="footer"> 
      <img src="../img/etf.jpg"/> 
      <div4><ui:include src = "contact.xhtml"/></div4> 
     </ui:insert> 
    </div3> 
</h:body> 

+0

我认为你可以调试更多...它是从哪里加载的,什么是网址,应该是什么网址和更多... – Kukeltje

+0

风格是否有理由在头之外? –

回答

0

的问题是,模板是在项目>网络>模板和其他页面都在项目>网络。当一个模板被包含在一个页面的url中时,它就不再是适合模板的url了。现在它可以在使用模板的页面中工作。

+0

但是,这应该已经在浏览器和服务器的404中相当可见,对吧?发布这个问题之前你有没有检查过这些东西? – Kukeltje