- 2008年2月16日 17:59
- プログラミング
前回に引き続き、自動生成したWicketプロジェクトがらみのないようです。
今回は、前回自動生成したWicketプロジェクトの中にある個々のファイルについて調べてみようと思います!
生成したプロジェクトの構成
プロジェクトの構成は以下の図のようになっています。
pom.xml
プロジェクト直下に存在するxmlファイル。
Mavenの設定ファイルなので、今のところは触らないでおきます。
src/main/javaディレクトリ
ソースファイルが格納されるディレクトリ。
以下のソースファイルが含まれます。
- WicketApplication.java
package com.mycompany; import org.apache.wicket.protocol.http.WebApplication; /** * Application object for your web application. If you want to run this application without deploying, run the Start class. * * @see wicket.myproject.Start#main(String[]) */ public class WicketApplication extends WebApplication { /** * Constructor */ public WicketApplication() { } /** * @see wicket.Application#getHomePage() */ public Class getHomePage() { return HomePage.class; } } - HomePage.java
Package com.mycompany; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.WebPage; /** * Homepage */ public class HomePage extends WebPage { private static final long serialVersionUID = 1L; // TODO Add any page properties or variables here /** * Constructor that is invoked when page is invoked without a session. * * @param parameters * Page parameters */ public HomePage(final PageParameters parameters) { // Add the simplest type of label add(new Label("message", "If you see this message wicket is properly configured and running")); // TODO Add your page's components here } } - HomePage.html
<html> <head> <title>Wicket Quickstart Archetype Homepage</title> </head> <body> <strong>Wicket Quickstart Archetype Homepage</strong> <br/><br/> <span wicket:id="message">message will be here</span> </body> </html>