5arVukovic 5arVukovic - 5 months ago 22
HTML Question

html picture not showing in JSF template

For some reason image etf.jpg will not show up, and i really think it has nothing to do with URL. When I ctrl+ click on the image in NetBeans it showed the picture just fine. Does it have something to do with insert tags?

!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>



Answer Source

The Problem was that templates were in Project>web>templates and other pages were in Project>web. When a template was included in a page url changes, and it i no longer url that is proper for the template. It is now url that works with the page in witch the template is used.