Is there anyway to check if required resource available or not
My code
<img id="photo" src="http://localhost:8081/test.png" />
Now suppose my image name is test.png
now what i want to do is check if http://localhost:8081/test.png
available or not
e.g <c:if test="${resource}">
if not available i want to put default.png
as http://localhost:8081/default.png
in the src which is available that i know for sure.
and If it is available then i will put src value to http://localhost:8081/test.png
How to do this??