Let's create a Movie site (if you haven't installed wicket yet, try http://wicket.apache.org/start/quickstart.html).
HomePage.html:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:wicket="http://wicket.apache.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>MovieDB</title>
</head>
<body>
<h1>MovieDB Homepage</h1>
</body>
</html>
HomePage.java:
package com.mycompany.moviedb;
import org.apache.wicket.markup.html.WebPage; public class HomePage extends WebPage { public HomePage() { } }
This initial version of the application consists of only one web page and there is no dynamic content in that page. In Wicket, we have to write two files for every page in the application: one is an HTML file that contains the template of the page, and the other is a Java source file containing the components that control the dynamic elements in the template. The name of the class (and therefore the base name of the Java source file) has to be the same as the base name of the HTML template file, as in HomePage.java and HomePage.html. Since, in our first example, there is no dynamic element in the template, there is no need for the class to supply any information to the template.






