Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are step-by-step instructions I put together a few months ago for installing Wicket. They list everything I did to set Wicket up on a vanilla machine with Eclipse installed.</p> <hr> <ul> <li>Downloaded JDK 6_22</li> <li>Downloaded Maven 3.01</li> <li>Installed JDK to C:\Program Files\Java\jdk1.6.0_22</li> <li><p>Unzipped maven to C:\Program Files\apache-maven-3.0.1</p></li> <li><p>Updated system environment variables:</p> <ul> <li><code>M2</code><br> C:\Program Files\apache-maven-3.0.1</li> <li><code>M2_HOME</code><br> %M2_HOME%\bin = C:\Program Files\apache-maven-3.0.1\bin</li> <li><code>JAVA_HOME</code><br> C:\Program Files\Java\jdk1.6.0_22</li> <li><code>M2_REPO</code><br> C:\Users\[username]\.m2\repository (exact path will vary based on your username/Windows version)</li> </ul></li> </ul> <p><b></b></p> <ul> <li><p>Followed instructions at <a href="http://wicket.apache.org/start/quickstart.html" rel="noreferrer">Wicket quickstart</a>, generating this Maven command:</p> <pre><code>mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4.1 -DgroupId=com.mycompany -DartifactId=projName </code></pre></li> <li><p>Ran above Maven command from command line</p></li> <li>Relevant files, including Wicket source, were downloaded automatically, based on POM.</li> <li>Ran <code>mvn eclipse:eclipse</code> to create an Eclipse project based on above</li> <li><p>Imported project into Eclipse with <code>File &gt; Import..., Existing Projects</code></p></li> <li><p>Ran <code>Start.java</code> in the test folder and found the test app up and running at <code>http://localhost:8080</code></p></li> </ul> <p><strong>Optional: support for third-party code, like Wicket Extensions</strong><br> Manually adding the Wicket Extensions JAR file to to the <code>M2_REPO</code> directory won't work.</p> <p>Instead, run <code>mvn clean dependency:copy-dependencies</code> after updating the POM. (Wicket Extensions is included but commented out in the default POM.) Then configure the build path in Eclipse by using <code>Add Variables...</code> (not <code>Add JARs</code>), select <code>M2_REPO</code>, press <code>Extend</code>, find the desired JAR (in this case, Wicket Extensions).</p> <p>A similar procedure should work for other third-party libraries.</p> <hr> <p>I was originally going to keep updating <a href="http://compiledpuns.blogspot.com/2010/12/wicket-installation.html" rel="noreferrer">this web page</a> with more instructions, but I've been working on other things lately. <s>Eventually, though, I hope to get around to instructions on how to configure Wicket with Tomcat instead of relying solely on the jetty server it comes with.</s></p> <h2>UPDATE</h2> <p>Instructions for deploying to Tomcat are here:</p> <ul> <li><p>Download and install <a href="http://tomcat.apache.org" rel="noreferrer">Apache Tomcat</a> and <a href="http://ant.apache.org" rel="noreferrer">Apache Ant</a>.</p></li> <li><p>Create the following directory structure:</p> <pre><code>\WicketTomcat +---src | +---main | | +---java | | | \---com | | | \---HelloWicket | | | HelloWorld.java | | | HelloWorld.html | | | HelloWorldApplication.java | | \---webapp | | \---WEB-INF | | web.xml | \---test | \---java +---lib | junit.jar | log4j.jar | servlet-api.jar | slf4j-api.jar | slf4j-log4j.jar | wicket.jar | wicket-extensions.jar +---target build.xml </code></pre></li> <li><p>Fill in the files as follows:</p></li> </ul> <p><strong>HelloWorld.java</strong></p> <pre><code>package com.HelloWicket; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; public class HelloWorld extends WebPage { public HelloWorld() { add(new Label("message", "Hello, Wicket!")); } } </code></pre> <p><strong>HelloWorld.html</strong></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Wicket Tomcat test title&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;span wicket:id="message"&gt;Message goes here&lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>HelloWorldApplication.java</strong></p> <pre><code>package com.HelloWicket; import org.apache.wicket.Page; import org.apache.wicket.protocol.http.WebApplication; public class HelloWorldApplication extends WebApplication { public HelloWorldApplication() { } /** * @see org.apache.wicket.Application#getHomePage() */ @Override public Class&lt;? extends Page&gt; getHomePage() { return HelloWorld.class; } } </code></pre> <p><strong>web.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt; &lt;web-app&gt; &lt;display-name&gt;Extremely simple example of deploying Wicket on Tomcat&lt;/display-name&gt; &lt;context-param&gt; &lt;param-name&gt;configuration&lt;/param-name&gt; &lt;param-value&gt;development&lt;/param-value&gt; &lt;!-- Wicket mode (development or deployment) --&gt; &lt;/context-param&gt; &lt;filter&gt; &lt;filter-name&gt;HelloWicket&lt;/filter-name&gt; &lt;!-- To be used in filter-mapping &gt; filter-name below --&gt; &lt;filter-class&gt; org.apache.wicket.protocol.http.WicketFilter &lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;applicationClassName&lt;/param-name&gt; &lt;param-value&gt; com.HelloWicket.HelloWorldApplication &lt;!-- Fully qualified name of WebApplication class --&gt; &lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;HelloWicket&lt;/filter-name&gt; &lt;!-- Must match filter &gt; filter-name above --&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;!-- Take control of all URLs that start with http://localhost:8080/HelloWicket/ --&gt; &lt;/filter-mapping&gt; &lt;/web-app&gt; &lt;!-- After deploying to Tomcat, access with http://localhost:8080/HelloWicket/. Source: http://wicket.apache.org/learn/examples/helloworld.html --&gt; </code></pre> <p><strong>build.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project default="war" name="HelloWicket" basedir="."&gt; &lt;property name="final.name" value="HelloWicket" /&gt; &lt;property name="src.main.dir" value="src/main/java" /&gt; &lt;property name="src.test.dir" value="src/test/java" /&gt; &lt;property name="src.web.dir" value="src/main/webapp" /&gt; &lt;property name="lib.dir" value="lib" /&gt; &lt;property name="build.dir" value="target" /&gt; &lt;property name="build.main.classes" value="${build.dir}/classes" /&gt; &lt;property name="build.test.classes" value="${build.dir}/test-classes" /&gt; &lt;property name="build.test.reports" value="${build.dir}/test-reports" /&gt; &lt;property name="build.reports.dir" value="${build.dir}/reports" /&gt; &lt;property name="tomcat.dir" value="..\..\..\..\Program Files\Apache Software Foundation\apache-tomcat-7.0.22\webapps" /&gt; &lt;path id="build.classpath"&gt; &lt;fileset dir="${lib.dir}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/path&gt; &lt;target name="clean"&gt; &lt;delete dir="${build.dir}" failonerror="false" /&gt; &lt;delete file="${final.name}.war" failonerror="false" /&gt; &lt;/target&gt; &lt;target name="init"&gt; &lt;mkdir dir="${build.dir}" /&gt; &lt;/target&gt; &lt;target name="compile" depends="init"&gt; &lt;mkdir dir="${build.main.classes}" /&gt; &lt;javac destdir="${build.main.classes}" target="1.6" source="1.6" srcdir="${src.main.dir}" classpathref="build.classpath" includeantruntime="false" /&gt; &lt;copy todir="${build.main.classes}"&gt; &lt;fileset dir="${src.main.dir}"&gt; &lt;include name="**/*.*" /&gt; &lt;exclude name="**/*.java" /&gt; &lt;/fileset&gt; &lt;/copy&gt; &lt;/target&gt; &lt;target name="test-compile" depends="compile"&gt; &lt;mkdir dir="${build.test.classes}" /&gt; &lt;javac destdir="${build.test.classes}" target="1.6" source="1.6" srcdir="${src.test.dir}" includeantruntime="false"&gt; &lt;classpath&gt; &lt;path refid="build.classpath" /&gt; &lt;pathelement path="${build.main.classes}" /&gt; &lt;/classpath&gt; &lt;/javac&gt; &lt;copy todir="${build.test.classes}"&gt; &lt;fileset dir="${src.test.dir}"&gt; &lt;include name="**/*.*" /&gt; &lt;exclude name="**/*.java" /&gt; &lt;/fileset&gt; &lt;/copy&gt; &lt;/target&gt; &lt;target name="test" depends="test-compile"&gt; &lt;mkdir dir="${build.test.reports}" /&gt; &lt;junit dir="./" failureproperty="test.failure" printSummary="yes" fork="true" haltonerror="true"&gt; &lt;sysproperty key="basedir" value="." /&gt; &lt;formatter type="xml" /&gt; &lt;classpath&gt; &lt;path refid="build.classpath" /&gt; &lt;pathelement path="${build.main.classes}" /&gt; &lt;pathelement path="${build.test.classes}" /&gt; &lt;/classpath&gt; &lt;batchtest todir="${build.test.reports}"&gt; &lt;fileset dir="${src.test.dir}"&gt; &lt;include name="**/*Test*.java" /&gt; &lt;/fileset&gt; &lt;/batchtest&gt; &lt;/junit&gt; &lt;mkdir dir="${build.reports.dir}" /&gt; &lt;junitreport todir="${build.reports.dir}"&gt; &lt;fileset dir="${build.test.reports}"&gt; &lt;include name="TEST-*.xml" /&gt; &lt;/fileset&gt; &lt;report format="frames" todir="${build.reports.dir}" /&gt; &lt;/junitreport&gt; &lt;/target&gt; &lt;target name="war" depends="test"&gt; &lt;war destfile="${build.dir}/${final.name}.war" webxml="${src.web.dir}/WEB-INF/web.xml"&gt; &lt;lib dir="lib"&gt; &lt;include name="wicket*.jar" /&gt; &lt;include name="slf4j*.jar" /&gt; &lt;include name="log4j*.jar" /&gt; &lt;include name="servlet*.jar" /&gt; &lt;/lib&gt; &lt;classes dir="${build.main.classes}" /&gt; &lt;fileset dir="${src.web.dir}"&gt; &lt;include name="**/*" /&gt; &lt;exclude name="**/web.xml" /&gt; &lt;/fileset&gt; &lt;/war&gt; &lt;/target&gt; &lt;target name="deploy" depends="war"&gt; &lt;echo&gt;Deploying .war to local Tomcat&lt;/echo&gt; &lt;copy todir="${tomcat.dir}"&gt; &lt;fileset dir="${build.dir}" includes="${final.name}.war" /&gt; &lt;/copy&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>As I did with the original answer, I posted a slightly more explanatory version of this answer <a href="http://compiledpuns.blogspot.com/2011/11/how-to-set-wicket-up-with-tomcat.html" rel="noreferrer">here</a>, but this should really be enough to get you going.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload