Apache Wicket , version 11

Write less, achieve more.

A component-oriented Java web framework: plain Java, plain HTML, no JavaScript build chain.

11.0.0 current10.11.0 LTS Release lines and support

8.x and 9.x are out of service since 11.0.0 — how to upgrade

A page is a tree of components

Java builds the tree with add(...), the HTML has the same nesting, and each wicket:id names the component that renders its tag. AddressPanel is written once, with its own markup, and the form uses it twice: the ribbon branches into the same shape for billing and shipping.

OrderPage.java

public class OrderPage extends WebPage {
    public OrderPage() {
        add(new Label("message", "Check both addresses."));
        Form<Void> form = new Form<>("order");
        form.add(new AddressPanel("billing", billingAddress));
        form.add(new AddressPanel("shipping", shippingAddress));
        form.add(new Button("save"));
        add(form);
    }
}

AddressPanel.java

public class AddressPanel extends Panel {
    public AddressPanel(String id, IModel<Address> address) {
        super(id, new CompoundPropertyModel<>(address));
        add(new TextField<String>("street"));
        add(new TextField<String>("city"));
    }
}

OrderPage.html

<html>
<body>
  <p wicket:id="message">Message</p>
  <form wicket:id="order">
    <div wicket:id="billing"></div>
    <div wicket:id="shipping"></div>
    <button wicket:id="save">Save</button>
  </form>
</body>
</html>

AddressPanel.html

<wicket:panel>
  <input wicket:id="street">
  <input wicket:id="city">
</wicket:panel>

Point at a component, or tab to the tree and use the arrow keys, to follow it from its Java line to its tag.

OrderPage as a tree

  1. OrderPage pageOrderPage.javaOrderPage.html
    1. "message" Labelnew Label("message", …)<p wicket:id="message">
    2. "order" Formnew Form<>("order")<form wicket:id="order">
      1. "billing" AddressPanelnew AddressPanel("billing", billingAddress)<div wicket:id="billing">
        1. "street" TextFieldnew TextField<String>("street")<input wicket:id="street">
        2. "city" TextFieldnew TextField<String>("city")<input wicket:id="city">
      2. "shipping" AddressPanel, reusednew AddressPanel("shipping", shippingAddress)<div wicket:id="shipping">
        1. "street" TextFieldnew TextField<String>("street")<input wicket:id="street">
        2. "city" TextFieldnew TextField<String>("city")<input wicket:id="city">
      3. "save" Buttonnew Button("save")<button wicket:id="save">

Both panels render AddressPanel.html, the panel's own markup inside <wicket:panel>.

Why Wicket

The component tree is where Wicket starts. Ajax, security and testing work on that same tree, from the same Java.

  1. Ajax without writing JavaScript

    Update parts of a page from Java. Wicket re-renders only the components you add to the request.

    CounterPage.java

    Label count = new Label("count", () -> clicks);
    add(count.setOutputMarkupId(true));
    
    add(new AjaxLink<Void>("increment") {
        @Override
        public void onClick(AjaxRequestTarget target) {
            clicks++;
            target.add(count);
        }
    });
  2. Secure by default

    A strict Content Security Policy without unsafe-inline: every header contribution gets a nonce automatically. URLs do not expose your model.

    MyApplication.java

    @Override
    protected void init() {
        super.init();
        // CSP is on by default; allow one extra image host
        getCspSettings().blocking()
            .add(CSPDirective.IMG_SRC,
                 "https://images.example.org");
    }
  3. Tested without a browser

    WicketTester renders pages and components in a plain unit test: no browser, no container. Check markup, click links, submit forms.

    HelloWorldTest.java

    WicketTester tester =
        new WicketTester(new MyApplication());
    tester.startPage(HelloWorld.class);
    tester.assertLabel("message", "Hello World!");
Internationalized
Over 25 languages, per application, page or component.
Many tabs, one session
Page state is stored, so new tabs and windows are safe.
Dependency injection
CDI, Spring and Guice integrations.
Jakarta EE
JPA, EJB, Bean Validation and CDI.
Your JavaScript and CSS
Global libraries beside component-local resources.

Open source since 2004

Wicket 1.0 came out on SourceForge in 2005. The component model it introduced is the one in Wicket 11.

An Apache project
Developed in the open at the Apache Software Foundation by a community of volunteers, under the Apache License 2.0.
Upgrades you can plan
Breaking changes only when needed, deprecated alternatives kept where possible, and every change documented in the migration guide.

Built with Wicket

  • ING Germany internet banking
  • ATLAS experiment at CERN controls and configuration
  • Air Tahiti
  • Stellantis media libraries
  • Coface
  • Ipsos
  • OneDev git server
  • ConSol CM

New in Wicket 11

Everything about Wicket 11

A new baseline

Java 21Jakarta Servlet 6.1Spring 7

Wicket 10 applications already use jakarta.servlet: the step up is your JDK and container.

More secure by default

Encrypted URLs and stored pages cannot be altered unnoticed, model values in markup are escaped consistently, and CSP covers script-src-attr and style-src-attr.

Leaner components

One compact state object per component: in the benchmarks, reading state is 30 to 45% faster and a tree with Ajax behaviors serializes about 40% smaller.

Ajax without jQuery

An opt-in plain JavaScript Ajax engine with the same client-side API. jQuery stays the default and now supports jQuery 4.

Get started

Generate a ready-to-run Maven project with the quick start, or add Wicket to the build you already have.

Open the quick start

11.0.0 for new features · Java 21

<dependency>
  <groupId>org.apache.wicket</groupId>
  <artifactId>wicket-core</artifactId>
  <version>11.0.0</version>
</dependency>

10.11.0 LTS for production · Java 17

<dependency>
  <groupId>org.apache.wicket</groupId>
  <artifactId>wicket-core</artifactId>
  <version>10.11.0</version>
</dependency>

Announcements

  1. A new release cadence for Apache Wicket

    Starting with Apache Wicket 11.0, Wicket moves to time-based releases: a new major release every three months, and an LTS release once a year. Wicket 10 is our current LTS and remains supported until the release of Wicket 14, expected in the first week of July 2027.

  2. Apache Wicket 10.11.0 released

  3. Apache Wicket 9.24.0 released

  4. Apache Wicket 8.19.0 released