bsridharg 0 Newbie Poster

have to display an image(available on the server as a resource) in the webpage using jstl. In the code, I have the image url, but before displaying it in the page, I need to validate if the image is available on the server to display.

I tried to use <c:import> but not able to verify if the image exists there. Following is the code I used.

<c:import url="${logoUrl}" var="imageData" />
<c:if test = "${imageData!=null && not empty imageData}">
display image..${imageData}
</c:if>

When the image is not available on the server, it still enters the if condition but gives a message as "the requested resource is not available"

Please let me know where I am going wrong.

Thanks in advance.