I'm using the h:graphicImage tag in HTML to load an image in a directory different from my current directory.
For example, say my working directory is:
/Users/nameOfUser/NetBeansProjects/MyProject/web
and the image is located in directory:
/Users/nameOfUser/Downloads/glassfish4/glassfish/domains/domain1/config/image.png
The tag is located in myHtml.xhtml (this file is in the web folder) and is as follows:
<h:graphicImage value="../../../Downloads/glassfish4/glassfish/domains/domain1/config/image.png"/>
I know that the path is correct by checking on command line, however I am receiving an IllegalArgumentException. I tried changing the path so that it was not a relative path. This solved the error however I need a relative path in order to locate the image properly.
Could anyone advise as to why this could be happening? Does this tag not accept relative paths?
Thanks in advance!
EDIT: I am using library:
xmlns:h="http://xmlns.jcp.org/jsf/html"