<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VolkomenJuist.nl &#187; Wicket</title>
	<atom:link href="http://www.volkomenjuist.nl/blog/tag/wicket/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.volkomenjuist.nl/blog</link>
	<description>Juist! Volkomen Juist!</description>
	<lastBuildDate>Mon, 18 Jul 2011 20:00:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to check whether Javascript is enabled in Wicket</title>
		<link>http://www.volkomenjuist.nl/blog/2010/01/19/how-to-check-whether-javascript-is-enabled-in-wicket/</link>
		<comments>http://www.volkomenjuist.nl/blog/2010/01/19/how-to-check-whether-javascript-is-enabled-in-wicket/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:31:49 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=337</guid>
		<description><![CDATA[It is possible, via Wicket, to gather a lot of information regarding the browser/system of your visitor. If you want this you can also turn on some extended information (like javascript is enabled) via the following code: This method works via a redirect to the BrowserInfoPage and finally it goes to your &#8216;original&#8217; page. Because [...]]]></description>
			<content:encoded><![CDATA[<p>It is possible, via Wicket, to gather a lot of information regarding the browser/system of your visitor. If you want this you can also turn on some extended information (like javascript is enabled) via the following code:</p>
<pre class="brush: java; title: ; notranslate">
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
</pre>
<p>This method works via a redirect to the BrowserInfoPage and finally it goes to your &#8216;original&#8217; page. Because of this it is possible that you see the BrowserInfoPage very shortly especially on slow computers/browsers or internet connections. But what if you don&#8217;t want this and only want to know whether Javascript is enabled? Please read on&#8230;</p>
<p><span id="more-337"></span></p>
<p>When the page is rendered it does a call(back) to Wicket. If  this callback is possible then we can assume Javascipt is enabled.</p>
<h4>How to setup?</h4>
<p>e.g. Login.java (Page)</p>
<pre class="brush: java; title: ; notranslate">
final WebClientInfo clientInfo = (WebClientInfo) WebRequestCycle.get().getClientInfo();
final AbstractDefaultAjaxBehavior behavior = new AbstractDefaultAjaxBehavior()
   @Override
   protected void respond(final AjaxRequestTarget target) {
        if (target != null) {
            clientInfo.getProperties().setJavaEnabled(true);
        }
   }
};
add(behavior);

Label jsEnabledScript = new Label(&quot;jsEnabledScript&quot;, &quot;wicketAjaxGet('&quot;+ behavior.getCallbackUrl() +&quot;', function() { }, function() { });&quot;);
jsEnabledScript.setEscapeModelStrings(false); // do not HTML escape JavaScript code
add(jsEnabledScript);
</pre>
<p>And in your HTML</p>
<pre class="brush: plain; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; wicket:id=&quot;jsEnabledScript&quot;&gt;&lt;/script&gt;
</pre>
<h4>How to use?</h4>
<pre class="brush: java; title: ; notranslate">
final WebClientInfo clientInfo = (WebClientInfo) WebRequestCycle.get().getClientInfo();
boolean javascriptEnabled = clientInfo.getProperties().isJavaEnabled();
</pre>
<address>Note1: Put this code on one of your first pages like your login page, to do this callback only once.<br />
Note2: I really don&#8217;t have a clue why they called it isJavaEnabled() because Java != Javascript&#8230;.</address>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=337" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2010/01/19/how-to-check-whether-javascript-is-enabled-in-wicket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AjaxTabbedPanel &#8211; Store state when switching tabs</title>
		<link>http://www.volkomenjuist.nl/blog/2009/12/01/ajaxtabbedpanel-store-state-when-switching-tabs/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/12/01/ajaxtabbedpanel-store-state-when-switching-tabs/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 21:48:09 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[AjaxTabbedPanel]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=331</guid>
		<description><![CDATA[Normally when you switch tabs of an AjaxTabbedPanel it won&#8217;t store the state of all your input fields. If you do want this, without pressing a save button, you have to override the newLink(String linkId, final int index) method of the AjaxTabbedPanel class and use an AjaxSubmitLink instead of the default AjaxFallbackLink. Now all values [...]]]></description>
			<content:encoded><![CDATA[<p>Normally when you switch tabs of an AjaxTabbedPanel it won&#8217;t store the state of all your input fields. If you do want this, without pressing a save button, you have to override the <code>newLink(String linkId, final int index)</code> method of the AjaxTabbedPanel class and use an AjaxSubmitLink instead of the default AjaxFallbackLink. Now all values will be stored in the model (not saved to the database). </p>
<p>Keep in mind that all Wicket validations will be validated, so we have to take care of the FeedbackPanel (refreshing) as well.</p>
<p><span id="more-331"></span><br />
Example:</p>
<pre class="brush: java; title: ; notranslate">
/**
	 * {@inheritDoc}
	 */
	@Override
	protected WebMarkupContainer newLink(String linkId, final int index) {

			return new AjaxSubmitLink(linkId, m_form) {

			@Override
			protected void onSubmit(AjaxRequestTarget target, Form&lt;?&gt; form) {
				setSelectedTab(index);
				if (target != null) {
					target.addComponent(TabbedComponent.this);
				}
				onAjaxUpdate(target);
			}

			@Override
			protected void onError(AjaxRequestTarget target, Form&lt;?&gt; form) {
				target.addComponent(((FeedbackAware) getPage()).getFeedbackPanel());
			}
		};
	}
</pre>
<p>See also my other blog about the <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy52b2xrb21lbmp1aXN0Lm5sL2Jsb2cvMjAwOS8xMS8wNS9hamF4dGFiYmVkcGFuZWwtaW4tY29tYmluYXRpb24td2l0aC1hamF4bGF6eWxvYWRwYW5lbC8jbW9yZS0zMjI=">AjaxTabbedPanel and LazyLoading</a></p>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=331" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/12/01/ajaxtabbedpanel-store-state-when-switching-tabs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AjaxTabbedPanel in combination with AjaxLazyLoadPanel</title>
		<link>http://www.volkomenjuist.nl/blog/2009/11/05/ajaxtabbedpanel-in-combination-with-ajaxlazyloadpanel/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/11/05/ajaxtabbedpanel-in-combination-with-ajaxlazyloadpanel/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 22:14:57 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[AjaxLazyLoadPanel]]></category>
		<category><![CDATA[AjaxTabbedPanel]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=322</guid>
		<description><![CDATA[Wicket (extensions) offers a AjaxTabbedPanel to take care of your tabs. The constructor of the AjaxTabbedPanel expects a wicket id (obviously) and a list of ITabs. The implementation of this interface should return the panel via getPanel(String panelId) which will be the &#8216;actual&#8217; tab. Out-of-the-box Wicket (extensions) offers an abstract implementation of this interface (AbstractTab). [...]]]></description>
			<content:encoded><![CDATA[<p>Wicket (extensions) offers a AjaxTabbedPanel to take care of your tabs. The constructor of the AjaxTabbedPanel expects a wicket id (obviously) and a list of ITabs. The implementation of this interface should return the panel via <code>getPanel(String panelId)</code> which will be the &#8216;actual&#8217; tab. Out-of-the-box Wicket (extensions) offers an abstract implementation of this interface (AbstractTab).</p>
<p>What I want to achieve is that an AjaxIndicator (loading image) will be shown on the place were the actual panel will come till it is completely loaded. Especially when you have a lot of components to render this can be handy. See image below.</p>
<div id="attachment_324" class="wp-caption aligncenter" style="width: 506px"><img class="size-full wp-image-324" title="example" src="http://www.volkomenjuist.nl/blog/wp-content/uploads/2009/11/example.png" alt="Example" width="496" height="200" /><p class="wp-caption-text">Example</p></div>
<p><span id="more-322"></span><br />
My solution was to create a class (AbstractLazyLoadTab) on top of the AbstractTab (implements ITab) which will take care of this. It will use the AjaxLazyLoadPanel.</p>
<pre class="brush: java; title: ; notranslate">
public abstract class AbstractLazyLoadTab extends AbstractTab {
         //removed some lines

	@Override
	public Panel getPanel(String panelId) {
		return new AjaxLazyLoadPanel(panelId){

			private static final long serialVersionUID = 1L;

			@Override
			public Component getLazyLoadComponent(String markupId) {
				return getLazyLoadPanel(final String markupId);
			}
		};
	}

        public abstract Panel getLazyLoadPanel(final String markupId);
}
</pre>
<p>Now you can use this class as you normally would do when you use AbstractTab.</p>
<p>When your page (or components higher in the hierarchy) implements IAjaxIndicatorAware to show another loading layer it is possible that you now have two loading layers on top of each other. One on the tab and one which will e.g. block the whole page. To avoid that I created an other class which extends the AjaxTabbedPanel and implements the IAjaxIndicatorAware interface.</p>
<pre class="brush: java; title: ; notranslate">
public class TabbedComponent extends AjaxTabbedPanel implements IAjaxIndicatorAware{
         //removed some lines
        @Override
	public String getAjaxIndicatorMarkupId() {
		//Our tab will take care of the loading layer, so return null.
		return null;
	}
}
</pre>
<p>Now you can use the classes like this:</p>
<pre class="brush: java; title: ; notranslate">
  List&lt;ITab&gt; tabs=new ArrayList&lt;ITab&gt;();
    tabs.add(new AbstractLazyLoadTab(new Model(&quot;first tab&quot;)) {
        public Panel getLazyLoadPanel(String panelId) {
           return new TabPanel1(panelId);
        }
    });

    add(new TabbedComponent(&quot;tabs&quot;, tabs)
</pre>
</pre>
<h2>Another solution</h2>
<p>If you prefer to have a waiting icon on the right side of the tab itself, you can override the newLink method of AjaxTabbedPanel and use the IndicatingAjaxFallbackLink instead of the AjaxFallbackLink. You will probably have to add the following code to your css file.</p>
<pre class="brush: css; title: ; notranslate">
span.wicket-ajax-indicator {
float: left;
}
</pre>
<p>More information about this solution please click <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2phdmF0aG91Z2h0cy5jYXBlc3VnYXJiaXJkLmNvbS8yMDA3LzExL2FqYXgtdGFiYmVkLXBhbmVsLXdpdGgtbGF6eS1sb2FkaW5nLmh0bWw=" target=\"_blank\">here</a></p>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=322" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/11/05/ajaxtabbedpanel-in-combination-with-ajaxlazyloadpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicket&#8217;s RequestLogger</title>
		<link>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 19:20:31 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[RequestLogger]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=262</guid>
		<description><![CDATA[Wicket provides you with a build-in request logger. It can give you a lot of information. See also example below. To activate this logger you have to enable the logger and setup (in our case) some Log4j configuration. In this post I&#8217;ll show you how to get this done. The example below shows you how [...]]]></description>
			<content:encoded><![CDATA[<p>Wicket provides you with a build-in request logger. It can give you a lot of information. See also example below. To activate this logger you have to enable the logger and setup (in our case) some Log4j configuration. In this post I&#8217;ll show you how to get this done.</p>
<p><span id="more-262"></span><br />
The example below shows you how to enable the requestLogger when the application is started in &#8220;Development&#8221; mode.</p>
<pre class="brush: java; highlight: [5,8]; title: ; notranslate">
//Check if we are not in deployment mode.
if (!DEPLOYMENT.equalsIgnoreCase(getConfigurationType())) {

  //Get the logger
  IRequestLoggerSettings reqLogger = Application.get().getRequestLoggerSettings();

  //Enable the logger
  reqLogger.setRequestLoggerEnabled(true);

  /**
  * Set the window of all the requests that is kept in memory for viewing. Default is 2000, You
  * can set this to 0 then only Sessions data is recorded (number of request, total time, latest
  * size)
  */
  reqLogger.setRequestsWindowSize(3000);
}
</pre>
<p>If you want to log everything to a specific rolling file you can add the following lines to your log4j.properties file. It will create a file for you with a max. size of 10MB. All Wicket requests will be logged into this file and not in the &#8216;general&#8217; log. </p>
<pre class="brush: java; title: ; notranslate">
log4j.category.org.apache.wicket.protocol.http.RequestLogger = info,reqLogger
log4j.additivity.org.apache.wicket.protocol.http.RequestLogger=false
log4j.appender.reqLogger=org.apache.log4j.RollingFileAppender
log4j.appender.reqLogger.File=D:/logs/wicketRequestLogger.txt
log4j.appender.reqLogger.MaxFileSize=10MB
log4j.appender.reqLogger.MaxBackupIndex=10
log4j.appender.reqLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.reqLogger.layout.ConversionPattern=%d %-5p - %-26.26c{1} - %m\n
</pre>
<p>Example logging:<br />
2009-04-08 16:18:32,878 INFO  &#8211; RequestLogger-<br />
time=687,<br />
event=Interface[target:Login$LoginForm(bodyTag:loginForm),<br />
page: eu.company.desktop.wicket.ui.login.Login(0),<br />
interface: IFormSubmitListener.onFormSubmitted],<br />
response=org.apache.wicket.request.target.basic.RedirectRequestTarget@1c82b58,<br />
sessionid=C488C8A534D1D853FD1F7A80C5647A52.jvm1,<br />
sessionsize=16239,<br />
sessionstart=Wed Apr 08 14:18:23 GMT 2009,<br />
requests=12,<br />
totaltime=3499,<br />
activerequests=1,<br />
maxmem=532M,<br />
total=163M,<br />
used=93M</p>
<p>That&#8217;s it.</p>
<p>Disclaimer: The requestLogger is very powerfull. I just started experimenting with it, so I don&#8217;t know all ins and outs yet. <img src='http://www.volkomenjuist.nl/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=262" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Wicket&#8217;s FormComponent setType</title>
		<link>http://www.volkomenjuist.nl/blog/2009/02/05/wickets-formcomponent-settype/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/02/05/wickets-formcomponent-settype/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:41:02 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Wicket]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[setType]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=143</guid>
		<description><![CDATA[If you are creating a form for your application you might need some validation on components before submitting. Wicket has some methods (e.g setRequired(true)) which can help you with that. In this article I will show you the setType method. This method will prevent you to submit the form when e.g. the input field is not filled in [...]]]></description>
			<content:encoded><![CDATA[<p>If you are creating a form for your application you might need some validation on components before submitting. Wicket has some methods (e.g <code>setRequired(true)</code>) which can help you with that. In this article I will show you the setType method. This method will prevent you to submit the form when e.g. the input field is not filled in correctly. An example could be when your users have to fill in a double as number. If the user fills in something else it will show a warning in the feedbackpanel. See java example below how to deal with this.</p>
<p><span id="more-143"></span></p>
<pre class="brush: java; title: ; notranslate">public HomePage(final PageParameters parameters) {

Form form = new Form(&quot;form&quot;, new CompoundPropertyModel(this));
add(form);

TextField tf = new TextField(&quot;doubleValue&quot;);
tf.setType(Double.class);
tf.setRequired(true);
form.add(tf);
form.add(new Button(&quot;bt1&quot;) {
 private static final long serialVersionUID = -1179492663996608643L;

 @Override
 public void onSubmit() {
  super.onSubmit();

  System.out.println(&quot;Form submitted&quot;);
}});

add(new FeedbackPanel(&quot;feedback&quot;).setOutputMarkupId(true));
}

public double getDoubleValue(){
 return m_value;
}

public void setDoubleValue(double value) {
 m_value = value;
} </pre>
<p>Please note the <code>setType(Double.class)</code> (line 7). This will prevent the user to submit the form when no double is filled in. Simply it doesn&#8217;t goes into the <code>onSubmit()</code> method. By default it will use the String type. This type will also be used when updating the model for this component.  </p>
<p>A shorter notation (instead of line 6 and 7):</p>
<pre class="brush: java; title: ; notranslate">TextField tf = new TextField(&quot;doubleValue&quot;, Double.class);
</pre>
<p>Corresponding HTML:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form wicket:id=&quot;form&quot;&gt;
&lt;input type=&quot;text&quot; wicket:id=&quot;tf1&quot;/&gt;
&lt;input type=&quot;submit&quot; wicket:id=&quot;bt1&quot;/&gt;
&lt;/form&gt;
&lt;div wicket:id=&quot;feedback&quot;/&gt;
</pre>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=143" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/02/05/wickets-formcomponent-settype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicket Debug / Deployment mode</title>
		<link>http://www.volkomenjuist.nl/blog/2009/01/25/wicket-debug-deployment-mode/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/01/25/wicket-debug-deployment-mode/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 11:31:47 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Wicket]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=121</guid>
		<description><![CDATA[By default, Wicket starts in development mode. When you want to deploy the application to your live system you will have to switch to deployment mode. This blog describes 3 ways to achieve this.   JVM Argument Servlet/filter initialization parameter Context initialization paramater. 1. JVM Argument Add the property -Dwicket.configuration=deployment to your JVM Arguments. This one is very usefull when you [...]]]></description>
			<content:encoded><![CDATA[<p>By default, Wicket starts in development mode. When you want to deploy the application to your live system you will have to switch to deployment mode. This blog describes 3 ways to achieve this.  </p>
<ol>
<li>JVM Argument</li>
<li>Servlet/filter initialization parameter</li>
<li>Context initialization paramater.</li>
</ol>
<p><span id="more-121"></span></p>
<h3>1. JVM Argument</h3>
<p>Add the property <code>-Dwicket.configuration=deployment</code> to your JVM Arguments. This one is very usefull when you want to switch on your local system to deployment mode (during development), because you don&#8217;t have to change files, only local settings. This property will be checked first so you can override the servlet/filter or context settings.</p>
<h3>2. Servlet/filter</h3>
<p>Example:</p>
<pre class="brush: xml; title: ; notranslate">&lt;filter&gt;
...
 &lt;init-param&gt;
  &lt;param-name&gt;configuration&lt;/param-name&gt;
  &lt;param-value&gt;deployment&lt;/param-value&gt;
 &lt;/init-param&gt;
...
&lt;/filter&gt;</pre>
<h3>3. Context</h3>
<p>Example:
<pre class="brush: xml; title: ; notranslate">&lt;context-param&gt;
 &lt;param-name&gt;configuration&lt;/param-name&gt;
 &lt;param-value&gt;deployment&lt;/param-value&gt;
&lt;/context-param&gt;</pre>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=121" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/01/25/wicket-debug-deployment-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Wicket project by using an Archetype</title>
		<link>http://www.volkomenjuist.nl/blog/2009/01/24/create-a-wicket-project-by-using-an-archetype/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/01/24/create-a-wicket-project-by-using-an-archetype/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 21:57:26 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Wicket]]></category>
		<category><![CDATA[Archetype]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=5</guid>
		<description><![CDATA[This article describes step-by-step how to setup a Wicket Quickstart project by using Maven2 Archetype. After finishing all steps you&#8217;ll be able to run the Quickstart project in your favourite webbrowser. I assume that you already have a Java Development Kit (JDK) installed. Now lets get started. 1. Software Download the latest stable versions from the following websites. JDK (http://java.sun.com/javase/downloads/) Maven2 (http://maven.apache.org/download.html) [...]]]></description>
			<content:encoded><![CDATA[<p>This article describes step-by-step how to setup a Wicket Quickstart project by using Maven2 Archetype. After finishing all steps you&#8217;ll be able to run the Quickstart project in your favourite webbrowser. I assume that you already have a Java Development Kit (JDK) installed. Now lets get started.</p>
<p><span id="more-5"></span></p>
<h2>1. Software</h2>
<p>Download the latest stable versions from the following websites.</p>
<ul>
<li>JDK (<a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2phdmEuc3VuLmNvbS9qYXZhc2UvZG93bmxvYWRzLw==">http://java.sun.com/javase/downloads/</a>)</li>
<li>Maven2 (<a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21hdmVuLmFwYWNoZS5vcmcvZG93bmxvYWQuaHRtbA==">http://maven.apache.org/download.html</a>)</li>
<li>Eclipse  (<a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5lY2xpcHNlLm9yZy9kb3dubG9hZHMv">http://www.eclipse.org/downloads/</a>)</li>
</ul>
<h2>2. Maven2</h2>
<ol>
<li>Unzip the downloaded file to a location of your choice. e.g &#8220;D:\Programming\apache-maven-2.0.9\&#8221;</li>
<li>Create a M2_HOME system variable<br />
- Press WinKey + Pause or go to Settings -&gt; Control Panel -&gt; System. Now a System Properties dialog will appear. Go to Advanced -&gt; Environment Variables. <br />
- Press New and create a new system variable with name <code>M2_HOME</code> and value <code>D:\Programming\apache-maven-2.0.9</code> Press OK</li>
<li> M2_HOME is added to the system variables. In the same list you&#8217;ll find  a &#8220;Path&#8221; variable. Edit this variable and add <code>%M2_HOME%\bin;</code> to the end of the list.  <br />
Make sure that there is also a <code>JAVA_HOME</code> system variable pointing to your JDK and the value <code>%JAVA_HOME%\bin;</code>  in your path variable.</li>
<li>Close all dialogs and go to the command line by pressing WinKey + R or Start -&gt; Run and type <code>cmd.exe</code>, press Enter.</li>
<li>On the commandline type <code>mvn --version</code> press Enter and if everything is configured correct you will see Maven&#8217;s version number. <br />
If it is not working properly close the command line by typing <code>exit</code> Enter and re-open the command line (see step 4).</p>
<p><div id="attachment_93" class="wp-caption aligncenter" style="width: 607px"><img class="size-full wp-image-93" title="mavenversion" src="http://www.volkomenjuist.nl/blog/wp-content/uploads/2009/01/mavenversion.jpg" alt="Output Maven" width="597" height="177" /><p class="wp-caption-text">Output Maven</p></div></li>
</ol>
<h2>3. Maven2 Repository</h2>
<p>By default Maven will create a local repository (.m2/repository) in your $user folder. If you want to specify the location of the local repository, create a file in $user/.m2/ called &#8220;settings.xml&#8221;. This file should contain the following lines. Change path if needed.</p>
<pre class="brush: xml; title: ; notranslate">&lt;settings&gt;
&lt;localRepository&gt;d:\programming\repository&lt;/localRepository&gt;
&lt;/settings&gt;</pre>
<h2>4. Archetype (Creating the project)</h2>
<ol>
<li>On the commandline go to your workspace directory e.g. &#8220;D:\Programming\Workspaces&#8221; by typing <code>d:</code> Enter and afterwards <code>cd Programming\Workspaces</code> Enter.</li>
<li>Type <code>mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.3.5 -DgroupId=com.mycompany -DartifactId=myproject</code> and press Enter.<br />
This will download all dependencies which are necessary and create a Maven2 project structure. It will create a directory with the name &#8220;myproject&#8221; in your workspaces directory and some Wicket quickstart files (in package &#8220;com.mycompany&#8221;). It will use Wicket version 1.3.5. You can change those properties to your needs!<br />
 </li>
</ol>
<h2> 5. Run Wicket&#8217;s Quickstart project</h2>
<ol>
<li>When everything is downloaded succesfull go to your project directory (&#8220;D:\Programming\Workspaces\myProject&#8221;) 
<div id="attachment_109" class="wp-caption aligncenter" style="width: 487px"><img class="size-full wp-image-109" title="mavenarchetypefinish" src="http://www.volkomenjuist.nl/blog/wp-content/uploads/2009/01/mavenarchetypefinish.jpg" alt="Maven Archetype created successfull" width="477" height="285" /><p class="wp-caption-text">Maven Archetype created successfull</p></div>
<p> </li>
<li>Type <code>mvn jetty:run</code> and wait till it is completely started. The first time it will take some time.</li>
<li>Open your favourite browser and browse to <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2xvY2FsaG9zdDo4MDgwL215cHJvamVjdA==">http://localhost:8080/myproject</a></li>
<li>Now you will see a Wicket page.</li>
</ol>
<h2>6. Eclipse (optional)</h2>
<ol>
<li>If you want to play around with the quickstart project. You have to import the project in your IDE. Before doing this you have to go to your project directory and type <code>mvn eclipse:eclipse -DdownloadSources=true</code> press Enter<br />
This will create some files for you to import the project in Eclipse.</li>
<li>Open Eclipse, go to File -&gt; Import</li>
<li>Go to General -&gt; Existing Projects in Workspace</li>
<li>Press Browse and point to your project directory. Press Finish.</li>
<li>Now the project will be loaded in Eclipse and is ready for you to make changes.</li>
</ol>
<h2>7. Software used for this article</h2>
<ul>
<li>JDK 1.6.0</li>
<li>Maven 2.0.9</li>
<li>Eclipse 3.4.0</li>
<li>Windows XP / Vista</li>
</ul>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/01/24/create-a-wicket-project-by-using-an-archetype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

