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.
The
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!"));
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Hello, World!</title>
</head>
<body>
<h1 wicket:id="msg">text goes here</h1>
</body>
</html>