0
我正在使用Primefaces 5.2,并且需要在我的网页上显示一些图像。 我正在使用来自primefaces的GraphicImage标签,并且在名称属性中我传递了图像的完整路径,但没有任何内容显示在网页上,当我检查生成的html页面的源代码时,有RES NOT NOT img标签的源属性值。jsf graphicimage标记不起作用
这里是我的代码
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Add your Experience</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</h:head>
<body>
<div class="container">
<p:contentFlow value="#{testBean.images}" var="image">
<p:graphicImage name="C:/Users/Singh/Desktop/Photos/#{image}"
styleClass="content" />
<div class="caption">#{image}</div>
</p:contentFlow>
<p:graphicImage name="image/bg.jpg" />
<h:graphicImage name="C:/Users/Singh/Desktop/Photos/abh.jpg"></h:graphicImage>
</h:form>
</div>
</body>
</html>
其用于其在项目中的图像工作,但对作为其不工作的项目目录外的图像。我想我需要写一个servlet – Ishada
哪个是你的服务器? – lametaweb