ICEfaces
  1. ICEfaces
  2. ICE-5061

Empty ice:graphicImage URL creates unnecessary views

    Details

      Description

      Returning an empty string for the src attribute of <ice:graphicImage/> will cause the browser to re-write the url to point to the main page of the application, fetch this new page, and create an additional view.

      This is clearly an application level issue, however, since it is relatively common we can add a check for this and if the 'src' attribute is blank or '/' (or null) then the component should do the following:

      1. Log and WARN level message, indicating the source page, the ice:graphicImage component ID (if any), and that the graphicImage 'src' attribute is blank.

      2. Replace the <image> tag in the rendered output for the graphicImage component with text "???". This will be easier to maintain than trying to load a specific image to display in this case. The key thing is that the image tag cannot request the incorrect image, or an unnecessary view will be created.

      Of course, if the 'src' attribute is anything but blank, null, or "/", then we should render as normal.

        Activity

        Hide
        Ken Fyten added a comment -

        Attached an image we can load when the src attribute is blank.

        Show
        Ken Fyten added a comment - Attached an image we can load when the src attribute is blank.
        Hide
        yip.ng added a comment -

        Can't find the image attachment redx.gif.

        Show
        yip.ng added a comment - Can't find the image attachment redx.gif.
        Hide
        yip.ng added a comment -

        Changed to output text "???". See screenshot-1.

        Also output warning message. See screenshot-2. (But there is no way to know the source page.)

        Show
        yip.ng added a comment - Changed to output text "???". See screenshot-1. Also output warning message. See screenshot-2. (But there is no way to know the source page.)
        Hide
        Adnan Durrani added a comment -

        Causing a regression to ICE-2528.

        Show
        Adnan Durrani added a comment - Causing a regression to ICE-2528 .
        Hide
        Adnan Durrani added a comment -

        Previous fix refactored.

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Completed: At revision: 19734

        Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java
        Completed: At revision: 19735

        Show
        Adnan Durrani added a comment - Previous fix refactored. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Completed: At revision: 19734 Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\ImageRenderer.java Completed: At revision: 19735

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: