Friday, September 13, 2013

JSF Errors: JSF1007: Duplicate component ID .. found in view

The exception described as JSF1007 could be thrown when in JSF View (JSF JSP or Facelets page) duplicate component IDs are found. In Mojarra implementation the exception can be thrown from method com.sun.faces.util.Util.checkIdUniqueness:

public static void checkIdUniqueness(FacesContext context, UIComponent component, Set<string> componentIds)
     Iterator kids = component.getFacetsAndChildren();
     while (kids.hasNext())
       UIComponent kid = (UIComponent);
       String id = kid.getClientId(context);
       if (componentIds.add(id)) {
         checkIdUniqueness(context, kid, componentIds);
       } else {
         if (LOGGER.isLoggable(Level.SEVERE)) {
           LOGGER.log(Level.SEVERE, "jsf.duplicate_component_id_error", id);
           FastStringWriter writer = new FastStringWriter(128);
           DebugUtil.simplePrintTree(context.getViewRoot(), id, writer);

       // The exception described as JSF1007 will be thrown here

No comments:

Post a Comment