I am having problems displaying images in my index.xhtml file.
I want the link from my database to point to an image file so that the <h:graphicImage/> or <img /> can display it. Currently only the local host is used.
I managed to save the image in c: \ var \ webapp \ images \, and also add <property name="alternatedocroot1" value="from=/images/* dir=/var/webapp" /> to my glassfish-web.xml and using:
<h:graphicImage value="#{entity.imageLink}" /> <img alt="#{entity.title}" src="#{entity.imageLink}" />
But I never manage to display any images! What should be written in my database to display imageExample.jpg, which is saved in c: \ var \ webapp \ images \ imageExample.jpg? My thought is that the problem is in my way, but I could very well be wrong.
source share