posted 18 years ago
Hi All,
I am try to check whether a image is there with in the war file or not. If found I will display the image at front end. If not I want to show a custom message.
Right not I am checking like
try {
session.getServletContext().getResourceAsStream("images/client1.gif").read();
return "images/client1.gif";
}catch (Exception e){
e.printStackTrace();
return "Not Found";
}
In the above code if it throws an exception then I get the "Not Found" message.
Is there a better way to achieve this.
Thanks!