Build web applications from Java components and plain HTML

Apache Wicket is a component-oriented Java web framework, open source since 2004 and a project of the Apache Software Foundation since 2007. Every component keeps its behaviour and state in Java and its markup in plain HTML, so there is no JavaScript build chain to maintain.

Get started

LTS
10.11.0 LTS supported until Jul 2027
Last release coming
9.24.0 · 8.19.0 one final release each, then end of life. See the upgrade paths.
Everything else
All releases and downloads

A page is a Java class and an HTML file

HomePage.java
public class HomePage extends WebPage {
    private int clicks;

    public HomePage() {
        add(new Link<Void>("count") {
            @Override
            public void onClick() {
                clicks++;
            }
        });
        add(new Label("clicks", () -> clicks));
    }
}
HomePage.html
<p>
  You clicked <span wicket:id="clicks">0</span> times.
  <a wicket:id="count">Click me</a>
</p>
  • The wicket:id joins each tag to the Java component with the same id. The HTML stays plain HTML that any editor opens.
  • A click runs onClick() on the server, and Wicket renders the page again.
  • The field clicks keeps its value between requests, because Wicket keeps the page object for you.
  • A part you reuse on many pages is a Panel: again a Java class and an HTML file. Components and markup shows how.

See the examples running

Why Wicket

  • Just Java and HTML

    Use what you know about Java and your favourite HTML editor. Behaviour lives in Java, markup stays plain HTML, and no JavaScript build is needed.

  • Secure by default

    URLs do not expose sensitive information and component paths are session-relative. Wicket supports a Content Security Policy without unsafe-inline: it adds a nonce to every header contribution itself.

  • Ajax without writing JavaScript

    Update selected parts of a page without a single line of JavaScript, with a large set of ready-made Ajax components.

  • Components you can reuse

    Pages and components are real Java objects with encapsulation, inheritance and events. Bundle a component with its stylesheets, JavaScript and other resources into one reusable package.

  • Tests without a browser

    WicketTester renders your pages and components in a unit test, without a browser or a container, and checks their markup, attributes and contents.

  • Stable for the long run

    Open source under the Apache License since 2004. Breaking changes only when needed, deprecated alternatives kept where possible, and every change documented in the migration guide.

Coming from Spring MVC, Jakarta Faces or Vaadin? Why component-oriented compares Wicket with request-based and other component frameworks, what it gains and what it costs, and the glossary gives each Wicket term with what other frameworks call it.

Also included: translations in over 25 languages, safe use of multiple tabs and windows, injection with CDI, Spring and Guice, Jakarta EE integration, and component-local JavaScript and CSS.

Built with Wicket

Many applications run on Wicket without saying so. These say so, collected through the Built with Wicket feed. Submit your own project.

Learn Wicket in five lessons

The lessons build one application, from an empty project to a tested page with Ajax. Every page of the documentation says which Wicket versions it covers.

  1. Build your first application Generate a project from the quickstart, run it, and build a home page with a label, a click counter and a link to a second page.
  2. Give every page the same layout Move the header, navigation and footer of your application into a base page and two panels, so every page shares one layout.
  3. Build a form that saves data Add a guestbook page with a form that validates its input, saves entries and lists them, and shows errors and a confirmation.
  4. Update a page with Ajax Make the click counter and the guestbook form update only the parts of the page that change, open the form without a reload, and refresh the guestbook every ten seconds.
  5. Test a page with WicketTester Write JUnit tests that render your pages, click links, submit the guestbook form and check Ajax updates, without a browser or a server.

Built by the people who use it

Apache Wicket is developed in the open by volunteers. Answer a question on the users list, report a bug with a quickstart, improve the documentation, or send a pull request to apache/wicket: a committer reviews it, and it goes out with the next release of its line.

How to contribute · Community and support