API / Apache Wicket Interview questions
Explain the lifecycle of a Wicket request from URL to rendered page?
A request in Wicket moves through a well-defined pipeline before any HTML reaches the browser, coordinated by the RequestCycle.
The WicketFilter is the servlet-level entry point that hands control to Wicket's RequestCycle, which uses a configured IRequestMapper to decide whether the URL points at an existing stateful page instance (a callback URL) or should construct a fresh page (a bookmarkable or mounted URL). Either way, before rendering, Wicket runs each component's onInitialize() (once, lazily, the first time a component is used) and onConfigure() (every render, to set visibility/enabled state) before actually walking the tree and merging it with the HTML template.
The final step writes the rendered HTML to the response and, for a stateful page, updates the session's page store with the (possibly changed) component state so the next callback on that page has something to act on.
More Related questions...