Not getting image in h:graphicImage in JSF
        Posted  
        
            by Nitesh Panchal
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Nitesh Panchal
        
        
        
        Published on 2010-03-31T09:44:30Z
        Indexed on 
            2010/03/31
            10:43 UTC
        
        
        Read the original article
        Hit count: 220
        
Hello, I have this very strange error with h:graphicImage
This code works fine :-
<h:graphicImage value="/Common/Images/#{item.templatePicName}"/>
And this one doesn't :-
<h:graphicImage alt="${app:getCommonImagePath(item.templatePicName)}"  value="${app:getCommonImagePath(item.templatePicName)}" />
It only shows alt value /Common/Images/Sunset.jpg which is perfectly fine and works in 1st case. Then why doesn't it work in 2nd case? There are no problems with my images. They are present in right directory.
here getCommonImagePath is my custom EL function, whose definition is :
package Common;
public final class AppDeployment {
    private AppDeployment(){ //hide constructor
    }
    private static String commonImageFolderPath = "/Common/Images/";
    public static String getCommonImagePath(String picName){
        return commonImageFolderPath + picName;
    }
}
        © Stack Overflow or respective owner