protected void checkIdUniqueness(FacesContext context, UIComponent component, Set<String> componentIds) throws IllegalStateException { // deal with children/facets that are marked transient. for (Iterator<UIComponent> kids = component.getFacetsAndChildren(); kids.hasNext();) { UIComponent kid = kids.next(); // check for id uniqueness 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); String message = MessageUtils.getExceptionMessageString( MessageUtils.DUPLICATE_COMPONENT_ID_ERROR_ID, id) + '\n' + writer.toString(); throw new IllegalStateException(message); } } }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); LOGGER.severe(writer.toString());
DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); LOGGER.severe(writer.toString());
DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); LOGGER.severe(writer.toString());
DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); LOGGER.severe(writer.toString());