5 Replies Latest reply on Dec 9, 2008 2:47 PM by Alexander Rühl

    How to avoid a 404 error in a <s:graphicImage>?

    Alexander Rühl Newbie
      Hi there,

      I use a <s:graphicImage> tag within a <rich:dataTable> in my xhtml page with a value containing an URL.
      How can I avoid getting a 404 error if the image where the URL points to doesn't exist?
      I would like to show some "no image available" instead and continue with displaying the page.
      The only way I could make it work was probing the existence by url.getContent() in the bean code and in case of an IOException return a default URL instead - but this can only be a workaround since each file gets unnecessarily loaded twice.
      Any ideas to avoid it or what to use instead for displaying the image?

      Thanks,
      Alex