ICEfaces
  1. ICEfaces
  2. ICE-7556

MyFaces 2: A warning is generated for all h:graphicImage tags that don't include an 'alt' attribute

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.RC1
    • Fix Version/s: 3.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      ICEfaces 3 MyFaces 2 ACE Showcase
    • Assignee Priority:
      P2
    • Affects:
      Sample App./Tutorial

      Description

      When running the ACE Showcase with MyFaces, any h:graphicImage that doesn't supply an 'alt' attribute generates the following warning:

      WARNING: Component UIGraphic j_id1378384490_1a3c8901:image has no attribute alt or attribute resolves to null. Path to component {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /showcase.xhtml][Class: javax.faces.component.html.HtmlBody,Id: _2068169349_6d256d7f][Class: org.icefaces.ace.component.panel.Panel,Id: j_id1803199580_452a22d8][Class: javax.faces.component.html.HtmlPanelGroup,Id: _1803199580_452a228d][Class: javax.faces.component.html.HtmlForm,Id: j_id1378384490_1a3c8901][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id1378384490_1a3c891b][Class: javax.faces.component.html.HtmlGraphicImage,Id: image]}

      This comes from the org.apache.myfaces.shared.renderkit.html.HtmlImageRendererBase:


      102 /*
      103 * Warn the user if the ALT attribute is missing.
      104 */
      105 if (uiComponent.getAttributes().get(HTML.ALT_ATTR) == null)
      106 {
      107 if(!facesContext.isProjectStage(ProjectStage.Development) && log.isLoggable(Level.WARNING))
      108 log.warning("Component UIGraphic " + uiComponent.getClientId(facesContext) + " has no attribute alt or attribute resolves to null. Path to component " + RendererUtils.getPathToComponent(uiComponent));
      109 }

      As you can see it only happens in Production Mode. This may actually be unintended (should be Development mode) and something we can petition them to change. However, I think it likely is intended since the 'alt' attribute is technically a required attribute as per the spec.

        Issue Links

          Activity

          Hide
          Ken Fyten added a comment -

          Mark, have these fixes been committed yet?

          Show
          Ken Fyten added a comment - Mark, have these fixes been committed yet?
          Hide
          Mark Collette added a comment -

          I fixed this in ICE-7420.

          Show
          Mark Collette added a comment - I fixed this in ICE-7420 .
          Hide
          Deryk Sinotte added a comment -

          The HTML specs technically list the img tag as requiring an 'alt' attribute. When running under MyFaces, if an alt attributed is not detected, then the HtmlImageRenderBase class logs the following warning (but only in 'Production' mode):

          21-Dec-2011 10:38:01 AM org.apache.myfaces.shared.renderkit.html.HtmlImageRendererBase encodeEnd
          WARNING: Component UIGraphic j_id1755868360_377d12ef:j_id1755868360_377d13d7 has no attribute alt or attribute resolves to null. Path to component

          {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /showcase.xhtml][Class: javax.faces.component.html.HtmlBody,Id: _2068169349_6d256d4b][Class: org.icefaces.ace.component.panel.Panel,Id: examplePanel][Class: javax.faces.component.html.HtmlPanelGroup,Id: _2072691499_452a228d][Class: javax.faces.component.html.HtmlForm,Id: j_id1755868360_377d12ef][Class: org.icefaces.ace.component.panel.Panel,Id: j_id1755868360_377d12f1][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id1755868360_377d12db][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id1755868360_377d1355][Class: javax.faces.component.html.HtmlCommandLink,Id: _1755868360_377d13cd][Class: javax.faces.component.html.HtmlGraphicImage,Id: j_id1755868360_377d13d7]}

          So all of our images should also include an alt attribute to prevent this from being logged. Looks like recent changes to the Showcase have re-introduced some images with alt attributes. Re-opening and assigning to Evgheni.

          Show
          Deryk Sinotte added a comment - The HTML specs technically list the img tag as requiring an 'alt' attribute. When running under MyFaces, if an alt attributed is not detected, then the HtmlImageRenderBase class logs the following warning (but only in 'Production' mode): 21-Dec-2011 10:38:01 AM org.apache.myfaces.shared.renderkit.html.HtmlImageRendererBase encodeEnd WARNING: Component UIGraphic j_id1755868360_377d12ef:j_id1755868360_377d13d7 has no attribute alt or attribute resolves to null. Path to component {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /showcase.xhtml][Class: javax.faces.component.html.HtmlBody,Id: _2068169349_6d256d4b][Class: org.icefaces.ace.component.panel.Panel,Id: examplePanel][Class: javax.faces.component.html.HtmlPanelGroup,Id: _2072691499_452a228d][Class: javax.faces.component.html.HtmlForm,Id: j_id1755868360_377d12ef][Class: org.icefaces.ace.component.panel.Panel,Id: j_id1755868360_377d12f1][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id1755868360_377d12db][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id1755868360_377d1355][Class: javax.faces.component.html.HtmlCommandLink,Id: _1755868360_377d13cd][Class: javax.faces.component.html.HtmlGraphicImage,Id: j_id1755868360_377d13d7]} So all of our images should also include an alt attribute to prevent this from being logged. Looks like recent changes to the Showcase have re-introduced some images with alt attributes. Re-opening and assigning to Evgheni.

            People

            • Assignee:
              Evgheni Sadovoi
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: