Prev Next

API / Apache Wicket Interview questions

Explain the internal working of Wicket's markup inheritance resolution?

When a Page or Panel subclass extends a parent that defines wicket:child, Wicket has to merge two separate HTML files into a single logical markup structure before it can render anything, and it does that merge once, at markup-loading time, rather than on every request.

flowchart TD A[Load subclass HTML file] --> B{Contains wicket:extend?} B -- No --> C[Treat as standalone markup, no inheritance] B -- Yes --> D[Walk up to superclass, load its HTML file] D --> E{Superclass HTML has wicket:child?} E -- No --> F[MarkupException: no insertion point found] E -- Yes --> G[Splice subclass's wicket:extend content into superclass's wicket:child position] G --> H{Superclass itself extends another class?} H -- Yes --> D H -- No --> I[Merged markup cached as this class's resolved markup] I --> J[Used for all future renders of this class]

Wicket loads the subclass's own HTML, and if it finds a wicket:extend block, walks up the Java class hierarchy to load the superclass's markup too, splicing the subclass's content into wherever the superclass declared wicket:child. This walk continues recursively if the superclass itself extends yet another markup-inheriting class, so a three- or four-level inheritance chain resolves correctly without any special-casing beyond repeating the same splice operation at each level.

Because this merged markup structure is cached after being resolved once, the recursive walk-and-splice cost is paid only the first time a given page class's markup is needed, not on every single request — a request that reuses an already-resolved class just renders against the cached merged structure directly.

What happens if a subclass's HTML has a wicket:extend block, but its superclass's HTML has no wicket:child tag?
How often is the recursive walk-and-splice merge cost actually paid for a given page class?

More Related questions...

What is Apache Wicket? What is a Wicket Component? What is a Wicket Page? What is the wicket:id attribute? What is an IModel in Wicket? What are the types of built-in form components in Wicket? What is a Wicket Panel? What is a Wicket Fragment? What is the purpose of the WicketApplication class? What are the types of models Wicket provides out of the box? Define markup inheritance in Wicket? What is a bookmarkable page in Wicket? How do you create a simple Wicket Link component? What is the purpose of PageParameters? What is WicketTester? Why does Wicket avoid using JSP for markup? Why do we use LoadableDetachableModel instead of a plain field reference? How does Wicket manage component state across requests? What is the difference between a stateful and a stateless page in Wicket? When should you use a Panel instead of a Fragment? What is the difference between PropertyModel and CompoundPropertyModel? What happens when you call setResponsePage() inside a Wicket event handler? What is the difference between Wicket 9 and Wicket 10? Which is better for a new project in 2026: Wicket 9 or Wicket 10, and why? How can you optimize page load performance in a large Wicket application? How do you troubleshoot a WicketRuntimeException about a missing wicket:id? Explain the lifecycle of a Wicket request from URL to rendered page? Explain the execution flow of an AjaxLink click in Wicket? Explain the internal working of Wicket's component tree rendering? What is the difference between an AjaxLink and a Link in Wicket? Why should you avoid storing large objects directly as page fields? What is a Wicket Behavior? How does Wicket integrate with Spring for dependency injection? What is the difference between IValidator and form-level validation in Wicket? How does Wicket support internationalization (i18n)? Explain the internal working of Wicket's URL mounting? What is the difference between Wicket 8, 9, and 10 in terms of Java/Jakarta support? How do you enforce authorization/roles in a Wicket application? What is the role of the wicket-auth-roles module? How does Wicket handle recent security vulnerabilities like session fixation issues? Explain the sequence of events when a Wicket Form is submitted? What is the difference between onSubmit() and onError() in a Wicket Form? How do you configure detachable models to avoid memory leaks in the HttpSession? What is the difference between Wicket's component-oriented approach and Spring MVC's request-oriented approach? Explain how Wicket's PackageResourceGuard works and why CVE-2026-43646 mattered? How do you integrate WebSockets into a Wicket application? What is the difference between page storage strategies (in-memory vs disk-based) in Wicket? Explain the internal working of Wicket's markup inheritance resolution? What is the difference between Apache Wicket, Spring MVC, and JSF? Explain how Wicket's CryptoMapper protects bookmarkable page URLs from tampering?
Show more question and Answers...


Comments & Discussions