API / Apache Wicket Interview questions
What is the difference between a stateful and a stateless page in Wicket?
The distinction comes down to whether Wicket keeps the page instance around in the session between requests, and that choice ripples into scalability, URL design, and what kind of components a page can safely use.
| Stateful page | Stateless page |
| Instance persists in the session | Rebuilt fresh on every request |
| Server memory grows with concurrent users | No per-user page memory footprint |
| Supports any component, including ones needing mutable server-side state | Components must avoid relying on state carried over between requests |
| Simple to write; the natural default | Requires deliberate design (e.g. StatelessForm) and slightly more care |
Stateless pages matter most for high-traffic, mostly-anonymous pages — a public landing page or a search-results page hit by thousands of concurrent visitors — where holding a full page instance per visitor in memory would become a scalability bottleneck the stateful default simply doesn't have to solve.
More Related questions...