【发布时间】:2013-03-28 06:14:00
【问题描述】:
我阅读了许多关于同一问题的帖子,“tomcat 服务器”端的解决方案是在元素内添加元素,我这样做了:
<Host>
<Context docBase="path_to_image" path="/images" />
.....
我现在的问题是,如果我试图通过 html 图像标签显示图像:
<img src="/images/dist/image_name.ext"/>
图像渲染没有任何问题,但我在使用 jsf 标签时遇到问题:
<h:graphicImage value="/images/dist/image_name.ext" />
这个标签的输出是:[http://localhost:8080/context_name/faces/images/dist/image_name.ext]
所以我想如果我可以从 jsf 组件指向 [http://localhost:8080/images/dist/image_name.ext] 它将解决这个问题,但我该怎么做呢?
有什么想法吗?
看到这篇文章http://balusc.blogspot.com/2007/04/imageservlet.html
但是如果我能像之前提到的那样通过 server.xml 解决这个问题会更好。
【问题讨论】: