I am using the below code to fetch images from my server :
<a href="#">
<img src="<%
if(user.getImageURL()!=null){
out.print(user.getImageURL);
}else{
out.print("images/no-profile-pic-small.jpg");
}%>" />
</a>
The above code handles the case when the imageURL is null, but how do I handle the case when the imageURL returns a proper URL but that image is not found on the server i.e. 404 Not Found ?
EDIT : The image is located on a different server.