Hello, World! Because every examples site needs one

HelloWorld demonstrates the basic structure of a web application in Wicket. A Label component is used to display a message on the home page for the application.

Java code

The

Java code

package org.apache.wicket.examples.basic.helloworld;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

public class HelloWorldPage extends WebPage {
    private static final long serialVersionUID = 1L;

    public HelloWorldPage() {
        add(new Label("msg", "Hello, World!"));
    }
}

HTML Markup

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Hello, World!</title>
</head>
<body>
    <h1 wicket:id="msg">text goes here</h1>
</body>
</html>

Browser output

x
-
+
Safari