小编The*_*eph的帖子

GlassFish alternatedocroot路径应该如何在h:graphicImage中显示图像?

我在index.xhtml文件中显示图像时遇到问题.

我希望我的数据库中的链接指向图像文件,以便一个<h:graphicImage/><img />标记可以显示它.目前仅使用localhost.

我已设法将图像保存到c:\ var\webapp\images \并添加<property name="alternatedocroot1" value="from=/images/* dir=/var/webapp" />到我的glassfish-web.xml并使用:

<h:graphicImage value="#{entity.imageLink}" />
<img alt="#{entity.title}" src="#{entity.imageLink}" />
Run Code Online (Sandbox Code Playgroud)

但我从来没有设法显示任何图像!应该在我的数据库中写什么来显示保存在c:\ var\webapp\images\imageExample.jpg中的imageExample.jpg?我的想法是问题出在我的道路上,但我可能错了.

jsf image glassfish

5
推荐指数
1
解决办法
460
查看次数

标签 统计

glassfish ×1

image ×1

jsf ×1