• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

.jsp help... "error" .jpg possible?

Homerboy

Lifer
I have a site created in .jsp but I cant think of a way to creat a "error" or "default" .jpg for the HTML to display if the called .jpg is not found.

so if the .jsp code called to insert XYZ.jpg into the HTML, but XYZ.jpg was not found, rather than display the stupid broen missing image icon in IE etc, it woudl default and insert ABC.jpg in its place?
 
I think this would have to be server side. All images would have to go through some jsp page, which would load the real image and spit it out. Another possibility would be a really tricky file not found custom page that somehow knew to spit out an image if it's an image but a standard file not found message otherwise.
 
I would have guessed you could do this with Apache, but I may be wrong.

One other uglier way to do it would be to try and load the image in your JSP using ImageIcon(URL), and if that if that evaluates as null, then generate a link to your ABC.jpg instead. You could create a static utility class to do this for all image links.

 
Back
Top