{"record":{"id":"0992c9d40f5095c1","repo":"theonedev/onedev","slug":"placeholder-tag-set-on-a-component-that-is-usually","errorCode":null,"errorMessage":"Placeholder tag set on a component that is usually not rendered into markup. Component id: %s, component tag: %s.","messagePattern":"Placeholder tag set on a component that is usually not rendered into markup\\. Component id: (.+?), component tag: (.+?)\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"server-core/src/main/java/org/apache/wicket/Component.java","lineNumber":4102,"sourceCode":"\t\t\t\tif (getFlag(FLAG_OUTPUT_MARKUP_ID))\n\t\t\t\t{\n\t\t\t\t\tString message = String.format(\"Markup id set on a component that is usually not rendered into markup. \" +\n\t\t\t\t\t                               \"Markup id: %s, component id: %s, component tag: %s.\",\n\t\t\t\t\t                               getMarkupId(), componentId, tagName);\n\t\t\t\t\tif (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalStateException(message);\n\t\t\t\t\t}\n\t\t\t\t\tlog.warn(message);\n\t\t\t\t}\n\t\t\t\tif (getFlag(FLAG_PLACEHOLDER))\n\t\t\t\t{\n\t\t\t\t\tString message = String.format(\n\t\t\t\t\t\t\t\"Placeholder tag set on a component that is usually not rendered into markup. \" +\n\t\t\t\t\t\t\t\"Component id: %s, component tag: %s.\", componentId, tagName);\n\t\t\t\t\tif (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalStateException(message);\n\t\t\t\t\t}\n\t\t\t\t\tlog.warn(message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Write the tag\n\t\t\ttag.writeOutput(getResponse(), !needToRenderTag(null),\n\t\t\t\tgetMarkup().getMarkupResourceStream().getWicketNamespace());\n\t\t}\n\t}\n\n\t/**\n\t * Replaces the body with the given one.\n\t * \n\t * @param markupStream\n\t *            The markup stream to replace the tag body in\n\t * @param tag\n\t *            The tag","sourceCodeStart":4084,"sourceCodeEnd":4120,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/Component.java#L4084-L4120","documentation":"Analogous to the markup-id case: a placeholder tag (setRenderBodyOnly / placeholder type settings) was set on a component that is not rendered into markup. Wicket logs a warning and throws IllegalStateException when ExceptionSettings.NotRenderableErrorStrategy is THROW_EXCEPTION, because the placeholder directive can never take effect.","triggerScenarios":"Calling setRenderBodyOnly(true) or configuring a placeholder tag type on a component that never writes a tag (transparent resolver / border body), while NotRenderableErrorStrategy == THROW_EXCEPTION.","commonSituations":"Placeholder usage inside borders or wicket:container regions; applications tightening exception settings to catch render bugs; refactoring that moved a component into a non-rendered position while keeping placeholder settings.","solutions":["Remove the placeholder/body-only setting from the non-renderable component.","Apply the setting to a parent container that is actually rendered.","Set ExceptionSettings.NotRenderableErrorStrategy to LOG_WARNING if the behavior is intentional."],"exampleFix":"// before\nLabel lbl = new Label(\"y\", \"v\");\nlbl.setRenderBodyOnly(true); // never rendered as tag\nadd(lbl);\n// after\nWebMarkupContainer box = new WebMarkupContainer(\"y\");\nbox.setRenderBodyOnly(true);\nbox.add(new Label(\"inner\", \"v\"));\nadd(box);","handlingStrategy":"validation","validationCode":"// only set placeholder/body-only on components that render a tag\nif (component instanceof WebMarkupContainer || component instanceof FormComponent) {\n    component.setRenderBodyOnly(true);\n}","typeGuard":null,"tryCatchPattern":"try { component.setRenderBodyOnly(true); } catch (IllegalStateException e) { log.warn(\"component not renderable: {}\", component.getId()); }","preventionTips":["Apply placeholder settings to container components, not leaf/non-rendered components.","Keep ExceptionSettings strategy aligned with your component tree conventions.","Re-check placeholder settings after moving components into borders."],"tags":["wicket","markup","placeholder","rendering"],"backgroundTag":"invalid-config-value","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}