p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Pro JSP (http://p2p.wrox.com/pro-jsp-93/)
-   -   validating an image before display using c:import (http://p2p.wrox.com/pro-jsp/86546-validating-image-before-display-using-c-import.html)

bsridharg February 3rd, 2012 07:02 AM

validating an image before display using c:import
 
I 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.
Code:

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


All times are GMT -4. The time now is 04:04 AM.

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.