Hello, I have a folder named Common/Images/Photounavailbale.jpg. Is this right way of refering to a image from root? I want to refer this image from any page in any folder in my web application.
private String getPhotoUnavailablePath = "/Common/Images/PhotoNotAvailable.jpg";
private String getPhotoUnavailablePath(){
return photoUnavailablePath;
}
And from my JSF page i write something like :-
<h:outputLink id ="blogPhoto" value="#{BlogBean.photoUnavailablePath}" >
<h:graphicImage value="#{BlogBean.photoUnavailablePath}" style="width: 180px;height: 180px;"/>
</h:outputLink>
I get the image to see in h:graphicImage. But when i click on it, i get 404 error. OutputLink doesn't get proper link to image. How is it possible? That h:graphicImage gets proper link and h:outputLink doesn't?
Further, this code works perfectly :-
<h:outputLink id ="blogPhoto" value="..#{BlogBean.photoUnavailablePath}" >
<h:graphicImage value="#{BlogBean.photoUnavailablePath}" style="width: 180px;height: 180px;"/>
</h:outputLink>
Just, by putting .., it works! Can anybody explain me what is happening and how do i solve this?