954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

validating an image before display using c:import

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 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.

bsridharg
Newbie Poster
1 post since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You