I have single ajax application in java. I am working with lots of file type images. But some file has no extension or may be bed extension(Non-popular) in this case i replace with default image in "javascript". Here I want to checkout at server side for each image request. and if image path not found then i want to replace with default image.
My existing scenario is below:
In Javascript
function getDefaultFileImageName(image){
image.onerror = "";
image.src = "Images/32px/_blank.png";
return true;
}
<img src='Images/32px/pdf.png' onerror='getDefaultFileImageName(this)' />
i have lots of images on page so in this case i get out put in firebug like this:
so i want server side-Java solution. So if image not exist then server self return default image.