html 图片未在 JSF 模板中显示
html picture not showing in JSF template
由于某些原因,图像 etf.jpg 不会显示,我真的认为它与 URL 无关。当我 ctrl+ 单击 NetBeans 中的图片时,图片显示得很好。跟插入标签有关系吗?
!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>
问题是模板在 Project>web>templates 中,而其他页面在 Project>web 中。当页面中包含模板时 url 发生变化,我不再 url 适合该模板。现在 url 与 中的页面一起使用模板。
由于某些原因,图像 etf.jpg 不会显示,我真的认为它与 URL 无关。当我 ctrl+ 单击 NetBeans 中的图片时,图片显示得很好。跟插入标签有关系吗?
!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>
问题是模板在 Project>web>templates 中,而其他页面在 Project>web 中。当页面中包含模板时 url 发生变化,我不再 url 适合该模板。现在 url 与 中的页面一起使用模板。