How to display images located in glass fish folder?

独自空忆成欢 提交于 2019-11-30 16:12:47
BalusC

As per the comments,

I tried adding this in glassfish-web.xml

<property name="alternatedocroot_1" value="from=/images/* dir=/test/webapp/images" /> 

Assuming that you're using Windows with GlassFish installed on C:\, then this specific configuration expects a folder C:\test\webapp\images\images with all the images therein.

If you actually have a folder C:\test\webapp\images, then you should be configuring as follows:

<property name="alternatedocroot_1" value="from=/images/* dir=/test/webapp" /> 

Also note that this is absolutely not in any way relative to the GlassFish installation folder or the webapp's deploy space, so "I created a images folder under glass fish domains" as per the question would absolutely not work this way.

If you actually have a C:\path\to\glassfish\domains\test\webapp\images folder, then you should be configuring it as follows:

<property name="alternatedocroot_1" value="from=/images/* dir=/path/to/glassfish/domains/test/webapp" /> 

See also:


Update: as per the glassfish-web.xml contents which you edited in your question afterwards, that <property> shouldn't go in <jsp-config>, but needs to be an immediate child of <glassfish-web-app>.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!