Photo: Veronika Biro on Unsplash

Apache Wicket

Write less, achieve more.

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

Releases

  • 11.0.0 Current supported until 12.0.0, Jan 2027Java 21, secure by default, pages that serialize about 40% smaller, and Ajax without jQuery.
  • 10.12.0 LTS supported until 14.0.0, Jul 2027

9.x and 8.x reached end of life: support ended with 11.0.0. How to upgrade

Release lines and support

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 page
    1. "message" Label
    2. "order" Form
      1. "billing" AddressPanel
        1. "street" TextField
        2. "city" TextField
      2. "shipping" AddressPanel, reused
        1. "street" TextField
        2. "city" TextField
      3. "save" Button

Tap a component to light its lines in the Java and the HTML below.

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

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);    }}

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.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"));    }}

AddressPanel.html

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

How Wicket works, in seven steps Components and markup See the examples running

Why Wicket

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.

  • 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.

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
  2. Give every page the same layout
  3. Build a form that saves data
  4. Update a page with Ajax
  5. Test a page with WicketTester

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.