A project of The Apache Software Foundation

Documentation

Guides, tutorials, and reference for Apache Wicket

Tutorial

Adding AJAX to your pages

Update parts of the page without full reloads using Wicket's built-in AJAX support

Tutorial

Building your first form

Collect user input with Wicket forms, models, validation, and feedback messages

Tutorial

Getting started with Wicket

Create your first Wicket application in 10 minutes

Tutorial

Page layouts with markup inheritance

Build reusable page layouts using Wicket's markup inheritance

Tutorial

Testing Wicket pages

Write tests for your Wicket pages and forms with WicketTester

How-To forms

How to build stateless forms

Use StatelessForm to avoid session dependency and page expiration issues

How-To forms

How to convert text input to numbers, dates, and custom types

Learn how to control the conversion from raw string input to typed Java objects like numbers, dates, and enums

How-To forms

How to handle file uploads

Upload single and multiple files using FileUploadField with size limits

How-To forms

How to handle multiple selections

Use ListMultipleChoice and Palette components for multi-select form inputs

How-To forms

How to nest forms

Use nested forms to split complex forms into reusable sub-forms

How-To forms

How to use checkboxes and radio buttons

Work with CheckBox, CheckBoxMultipleChoice, and RadioChoice components

How-To forms

How to use multiple submit buttons

Add multiple submit buttons to a form using Button and SubmitLink components

How-To forms

How to validate form input and show error messages

Learn how to add validation rules to form fields and display feedback messages when input is invalid

How-To forms

How to validate forms with annotations like @NotNull

Learn how to use Jakarta Bean Validation (JSR 303) annotations on your domain objects and have Wicket enforce them automatically

How-To ajax

Built-in AJAX components

Overview of AJAX-enabled components shipped with Wicket including links, buttons, editable labels, and tree repeaters

How-To ajax

How to make any component respond to browser events via AJAX

Learn how to attach built-in AJAX behaviors to existing components so they react to clicks, changes, and other events

How-To ajax

How to refresh parts of the page without reloading

Learn how to use AjaxRequestTarget to update individual components and run JavaScript without a full page reload

How-To ajax

How to run JavaScript before, during, or after AJAX calls

Learn how to customize AJAX request attributes and attach client-side listeners for loading indicators, confirmations, and error handling

How-To ajax

How to use AJAX on stateless pages

Make AJAX components and behaviors work on stateless Wicket pages by overriding getStatelessHint

How-To repeaters

How to add paging to large lists

Learn how to display large datasets one page at a time using DataView and a paging navigator

How-To repeaters

How to display a list with nested components

Learn how to use ListView to render a list of objects with rich markup containing links, labels, and other components

How-To repeaters

How to keep form state when repeating items

Learn how to control which child components are recreated or reused when a repeater re-renders

How-To repeaters

How to render a dynamic number of items

Learn how to repeat a simple HTML fragment once per item using RepeatingView

How-To html-control

How to add or change HTML attributes from Java

Learn how to use AttributeModifier to dynamically set CSS classes, styles, data attributes, and other HTML attributes from your Java code

How-To html-control

How to automatically hide labels when their content is invisible

Learn how to use wicket:enclosure to automatically hide surrounding markup when a component is not visible

How-To html-control

How to control component visibility

Learn how to show, hide, and disable components programmatically and understand how visibility affects the component hierarchy

How-To html-control

How to create reusable page wrappers

Learn how to use Border to wrap page content with reusable decorating markup like headers, footers, and sidebars

How-To html-control

How to switch between different HTML blocks at runtime

Learn how to use Fragments to conditionally display different sections of markup without creating separate panel classes

How-To resources

How to add CSS and JavaScript to your pages

Learn how to include stylesheets and scripts in the page header from your components and behaviors

How-To resources

How to control CSS and JavaScript load order

Learn how to declare dependencies between stylesheets and scripts so they load in the right order

How-To resources

How to generate dynamic content like PDFs or JSON

Learn how to create custom resources that generate files on the fly, such as RSS feeds, CSV exports, or PDF documents

How-To resources

How to serve CSS, JS, and images from your Java packages

Learn how to bundle static files alongside your components so they stay self-contained and reusable

How-To resources

How to serve files at custom URLs

Learn how to mount resources at clean, predictable URLs instead of using auto-generated paths

How-To i18n

How to control where Wicket looks for translations

Learn how the resource bundle lookup algorithm works and how to customize where translation files are found

How-To i18n

How to display localized text in components

Learn how to use ResourceModel and StringResourceModel to show translated, parameterized text in your UI

How-To i18n

How to make your application multilingual

Learn how to set the user's locale and provide translated strings through properties files

How-To security

How to configure Content Security Policy

Set up Content Security Policy headers in Wicket to prevent XSS attacks

How-To security

How to enforce HTTPS

Configure Wicket to require HTTPS connections for secure pages

How-To security

How to implement login

Implement authentication and login pages in Apache Wicket

How-To security

How to prevent CSRF attacks

Protect your Wicket application against cross-site request forgery

How-To security

How to restrict access by role

Set up role-based authorization to restrict page access in Wicket

How-To security

How to restrict which file types Wicket serves

Learn how to configure package resource guards so that only safe file extensions are accessible from the browser

How-To urls

How to create bookmarkable links

Create bookmarkable page links that users can share and bookmark

How-To urls

How to mount pages with clean URLs

Mount Wicket pages at custom URL paths for clean, SEO-friendly URLs

How-To urls

How to use page parameters

Pass and retrieve page parameters in Wicket pages

How-To testing

How to test forms

Test form submission and validation with WicketTester

How-To testing

How to test markup with TagTester

Use TagTester to verify generated HTML markup in Wicket tests

How-To testing

How to test pages with WicketTester

Use WicketTester to unit test your Wicket pages and components

How-To integration

How to call JavaScript from Java and vice versa

Learn how to wrap a JavaScript widget in a Wicket component and communicate between client and server

How-To integration

How to integrate with Spring

Integrate Apache Wicket with the Spring Framework for dependency injection

How-To integration

How to use WebSockets

Add real-time WebSocket communication to your Wicket application

Reference

Component lifecycle — stages and hook methods

The stages a Wicket component goes through from creation to removal, and which methods to override at each stage

Reference

Configuration

Configuring your Wicket application settings and deployment options

Reference

Glossary — Wicket terminology explained

Plain-English explanations of Wicket terms like Models, Behaviors, Resources, and Panels

Reference

Maven setup

Setting up a Wicket project with Apache Maven

Reference

Models — connecting components to data

How Wicket models work as the bridge between your components and their underlying data

Reference

Request processing — from HTTP to rendered page

How an HTTP request travels through Wicket's request cycle, filters, and mappers to produce a response

Reference

Wicket modules and dependencies

Overview of Wicket's module structure and their dependencies

Explanation

Best practices

Recommended patterns and practices for building Wicket applications

Explanation

Markup inheritance — sharing layouts across pages

How to define a base page layout once and let child pages fill in their own content areas

Explanation

Page storage internals

How Wicket stores and manages page instances internally

Explanation

Stateful vs stateless pages — when sessions matter

Why some pages store state in the session and others do not, and how that affects performance, bookmarkability, and scalability

Explanation

Why Wicket

Understanding the benefits and philosophy behind Apache Wicket