<?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>STUQ.nl &#187; Scala</title>
	<atom:link href="http://stuq.nl/category/scala/feed" rel="self" type="application/rss+xml" />
	<link>http://stuq.nl</link>
	<description></description>
	<lastBuildDate>Thu, 30 Dec 2010 10:23:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automatically test your Wicket panel HTML markup</title>
		<link>http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup</link>
		<comments>http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup#comments</comments>
		<pubDate>Sun, 01 Nov 2009 20:03:04 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket Tutorials]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Unit testing]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=471</guid>
		<description><![CDATA[Are you testing your HTML markup automatically yet? If your markup does not match the Java code, your Wicket panel does not work. It’s easy to get early feedback when your panels are broken: just unit test them!

In this blog post I describe a way of automatically verifying that the HTML markup of Wicket panels match the Java code. <strong>Scroll down to download the demo project!</strong><p>Read the original at <a href="http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup">Automatically test your Wicket panel HTML markup</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Are you testing your HTML markup automatically yet? If your markup does not match the Java code, your Wicket panel does not work. It’s easy to get early feedback when your panels are broken: just unit test them!</p>
<p>In this blog post I describe a way of automatically verifying that the HTML markup of Wicket panels match the Java code. <strong>Scroll down to download the demo project!</strong></p>
<h3>Unit test</h3>
<p><img style="float: right; clear: right; padding: 5px;" title="Unit testing Wicket panels with Eclipse" src="http://stuq.nl/media/eclipse-unit-testing.png" alt="Unit testing Wicket panels with Eclipse" />I created a JUnit test that you can add to your project to <strong>automatically test as much Wicket Panels</strong> as possible. Automatic testing works by resolving all panels on the Java class path and feeding them to the WicketTester. When a panel has invalid markup, the WicketTester will give an error: early feedback!</p>
<h3>How does it work?</h3>
<p>The Wicket panels that can automatically be tested should have a ‘default’ Wicket constructor, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> DemoPanel<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> id<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Resolving all panels is done with Spring 2.5’s <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0YXRpYy5zcHJpbmdzb3VyY2Uub3JnL3NwcmluZy9kb2NzLzIuNS54L2FwaS9vcmcvc3ByaW5nZnJhbWV3b3JrL2NvbnRleHQvYW5ub3RhdGlvbi9DbGFzc1BhdGhTY2FubmluZ0NhbmRpZGF0ZUNvbXBvbmVudFByb3ZpZGVyLmh0bWw=" target=\"_blank\">ClassPathScanningCandidateComponentProvider</a> (don’t you love those names! How can they stay below 120 characters per line?)</p>
<p>The <strong>ClassPathScanningCandidateComponentProvider</strong> is a component provider that scans the classpath from a base package. It then applies exclude and include filters to the resulting classes to find candidates.</p>
<h3>Testing panels</h3>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testAllWicketPanels<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
        WicketTester wicketTester <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WicketTester<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WicketApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    	ClassPathScanningCandidateComponentProvider provider <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClassPathScanningCandidateComponentProvider<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        provider.<span style="color: #006633;">addIncludeFilter</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AssignableTypeFilter<span style="color: #009900;">&#40;</span><span style="color: #003399;">Panel</span>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">Set</span> components <span style="color: #339933;">=</span> provider.<span style="color: #006633;">findCandidateComponents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;nl/stuq/demo&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>BeanDefinition component <span style="color: #339933;">:</span> components<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">Class</span> clazz <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span>component.<span style="color: #006633;">getBeanClassName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hasDefaultConstructor<span style="color: #009900;">&#40;</span>clazz<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            	testWicketPanel<span style="color: #009900;">&#40;</span>wicketTester, clazz<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> testWicketPanel<span style="color: #009900;">&#40;</span>WicketTester wicketTester, <span style="color: #000000; font-weight: bold;">Class</span> clazz<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	wicketTester.<span style="color: #006633;">startPanel</span><span style="color: #009900;">&#40;</span>clazz<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	wicketTester.<span style="color: #006633;">assertNoErrorMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	wicketTester.<span style="color: #006633;">assertNoInfoMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> hasDefaultConstructor<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> clazz<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Constructor</span> constructor <span style="color: #339933;">:</span> clazz.<span style="color: #006633;">getConstructors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>constructor.<span style="color: #006633;">getParameterTypes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span>
               constructor.<span style="color: #006633;">getParameterTypes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getSimpleName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;String&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>The test instantiates a new WicketTester. After that, the <strong>ClassPathScanningCandidateComponentProvider</strong> is created and configured to scan only for Panel classes in the <tt>nl.stuq.demo</tt> package and below.<br />
After that, the found components are all checked. If they have a default constructor, the test is executed.</p>
<p>The <strong>boolean hasDefaultConstructor(clazz)</strong> method checks if the class has a constructor with only one String argument, the Wicket id.</p>
<h3>Keep in mind</h3>
<ul>
<li>This is only for lazy people (good developers are lazy in some ways).</li>
<li>You need a dependency to Spring.</li>
<li>Only Panels with a certain constructor are tested.</li>
<li>Only instantiating the Panel is tested, so code coverage has no meaning for this test. <strong>Real testing is still needed.</strong></li>
</ul>
<h3>Download demo project</h3>
<p>The demo project is a Maven project based on the Wicket 1.4.3 quickstart that contains the test class and an example panel to be tested.<br />
<strong><a onclick=\"javascript: pageTracker._trackPageview('/downloads/media/code/demo-automatic-panel-testing.zip');\" href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L21lZGlhL2NvZGUvZGVtby1hdXRvbWF0aWMtcGFuZWwtdGVzdGluZy56aXA=">Download demo project</a></strong>.</p>
<p>Extract the zip file and run <strong>mvn test</strong> to run the tests. Then fire up your IDE and check how it&#8217;s done.</p>
<p>You can change or adapt the given JUnit test to also automatically test classes extending from Page or Component.</p>
<p>Join in with your opinions and code! I’m curious to see what clever way you have of testing code.</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMTEtMDEvYXV0b21hdGljYWxseS10ZXN0LXlvdXItd2lja2V0LXBhbmVsLWh0bWwtbWFya3Vw">Automatically test your Wicket panel HTML markup</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=471" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup&amp;text=Automatically test your Wicket panel HTML markup&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup&amp;t=Automatically test your Wicket panel HTML markup">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup&amp;title=Automatically test your Wicket panel HTML markup&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2009-11-01%2Fautomatically-test-your-wicket-panel-html-markup&name=STUQ.nl&description=Automatically+test+your+Wicket+panel+HTML+markup" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ApacheCon Europe 2009 community meetup experiences</title>
		<link>http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences</link>
		<comments>http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences#comments</comments>
		<pubDate>Fri, 03 Apr 2009 21:17:56 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=443</guid>
		<description><![CDATA[<em>In this guest post, <a href="http://twitter.com/mtolsma">Minze Tolsma</a>, software developer at <a href="http://www.capgemini.com">Capgemini</a> shares his experiences attending the ApacheCon community meetups.</em><p>Read the original at <a href="http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences">ApacheCon Europe 2009 community meetup experiences</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009' rel='bookmark' title='Amsterdam Wicket meetup 2009'>Amsterdam Wicket meetup 2009</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><img title="ApacheCon" src="http://stuq.nl/media/apachecon_photo-150x150.jpg" alt="ApacheCon" width="150" height="150" /><em>In this guest post, <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL210b2xzbWE=">Minze Tolsma</a>, software developer at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jYXBnZW1pbmkuY29t">Capgemini</a> shares his experiences attending the ApacheCon community meetups.</em></p>
<p>This year I went to the ApacheCon community meetups. There were several, but I chose to attend the Maven and the Wicket meetup. I made some short notes on the most interesting things.</p>
<h3>Monday 23-03-2009: Maven</h3>
<p>The meetup on Maven was about new features and new projects.</p>
<h4>Eclipse Integration</h4>
<p>The community is working on a new tool for Eclipse Integration called Eclipse IAM (Integration for Apache Maven). The plugin aims at simplicity and will bring the best Eclipse integration for what Maven offers. It will integrate with JDT and WTP. The following features will be in the package:</p>
<ul>
<li>Direct project import with a POM. Instead of using the Eclipse archetype.</li>
<li>You can setup projects in Eclipse by using predefined archetypes.</li>
<li>You can configure autobuilds so building isn’t annoying.</li>
<li>There will be a FormBased POM editor, just like you are used to in Eclipse.</li>
<li>Dependency search</li>
<li>Dependency management</li>
<li>Dependency graphing and analysis</li>
</ul>
<p>Eclipse IAM will be worth looking at, it can be found at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5lY2xpcHNlLm9yZy9pYW0v">http://www.eclipse.org/iam/</a>.</p>
<h4>Maven 3.0 new features</h4>
<p>The community is working on Maven 3.0. Some new features:</p>
<ul>
<li>Embeddable, so it will be faster</li>
<li>Some improvements to make it easier to use with the repository</li>
<li>New transport mechanism for simultaneous downloads.</li>
</ul>
<p>Eclipse 3.0 projectpage: <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RvY3MuY29kZWhhdXMub3JnL2Rpc3BsYXkvTUFWRU4vTWF2ZW4rMy4wLng=">http://docs.codehaus.org/display/MAVEN/Maven+3.0.x</a><br />
After this two subjects and some live demos there was an open discussion. Because it was late in the evening I left. One thing I wrote down is that SourceSense made an <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlcG9zaXRvcnkuc291cmNlc2Vuc2UuY29tL21hdmVuMi1zaXRlcy9tYXZlbi1hbGZyZXNjby1hcmNoZXR5cGVzLw==">Alfresco archetype for Maven</a>.</p>
<h3>Tuesday 24-03-2009: Wicket</h3>
<p>The Wicket meetup was quite different in comparison with the Wicket meeting. There where several presentations about testing, Scala and Wicket, Wicket and DB4O.</p>
<h4>JDave</h4>
<p>For testing nothing was really new… Except the following framework for Behaviour Driven Development: JDave. More info on: <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5qZGF2ZS5vcmcvIA==">http://www.jdave.org/</a>.<br />
Presentation of the ApacheCon and examples on: <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5qZGF2ZS5vcmcvYmRkLXdpY2tldC8g">http://www.jdave.org/bdd-wicket/</a>.</p>
<h4>DB4O</h4>
<p>DB4O is a Object Database for Java and .NET shipped with two different licenses. More detailed information about DB4O can be found on the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kYjRvLmNvbS8g">DB4O website</a>.</p>
<p>You can look at DB4O as a large factory (like the Factory design pattern (GoF)) just for storage. It is a good practice to use some  XML storage together with DB4O. For this you can use <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3hzdHJlYW0uY29kZWhhdXMub3JnLyA=">XStream</a>. Using XML for storage together with object storage offers you a good backup mechanism.</p>
<p>Some disadvantages of DB4O are:</p>
<ul>
<li>When data is corrupt there are strange exceptions.</li>
<li>Version Management for the objects is hard to do.</li>
</ul>
<h4>Scala and Wicket</h4>
<p>The presentation about Scala and Wicket was really a hands-on presentation. The slides, code examples and handouts can be found at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDItMDQvZG93bmxvYWQtdGhlLWJhc2ljLWFuZC13aWNrZXQtc2NhbGEtdGFsay1tYXRlcmlhbHM=">http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials</a>. Just try it and get introduced to the concepts of functional programming using the JVM and Wicket.</p>
<p>After all I had two nice evenings and learned a lot. I hope this article gives you some nice and hopefully new useful information!</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDQtMDMvYXBhY2hlY29uLWV1cm9wZS0yMDA5LWNvbW11bml0eS1tZWV0dXAtZXhwZXJpZW5jZXM=">ApacheCon Europe 2009 community meetup experiences</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=443" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences&amp;text=ApacheCon Europe 2009 community meetup experiences&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences&amp;t=ApacheCon Europe 2009 community meetup experiences">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences&amp;title=ApacheCon Europe 2009 community meetup experiences&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2009-04-03%2Fapachecon-europe-2009-community-meetup-experiences&name=STUQ.nl&description=ApacheCon+Europe+2009+community+meetup+experiences" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009' rel='bookmark' title='Amsterdam Wicket meetup 2009'>Amsterdam Wicket meetup 2009</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amsterdam Wicket meetup 2009</title>
		<link>http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009</link>
		<comments>http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009#comments</comments>
		<pubDate>Tue, 24 Mar 2009 18:36:45 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=436</guid>
		<description><![CDATA[At the Amsterdam Wicket meetup 2009 I did a presentation about Scala and Wicket. Click below to read the entire post and download everything!<p>Read the original at <a href="http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009">Amsterdam Wicket meetup 2009</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences' rel='bookmark' title='ApacheCon Europe 2009 community meetup experiences'>ApacheCon Europe 2009 community meetup experiences</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-27/london-wicket-meetup-wicket-1-5-wiquery-brix-and-more' rel='bookmark' title='London Wicket Meetup: Wicket 1.5, WiQuery, Brix and more..'>London Wicket Meetup: Wicket 1.5, WiQuery, Brix and more..</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>At the Amsterdam Wicket meetup 2009 I did a presentation about Scala and Wicket. These are all the materials that you can download to get started with Scala and Wicket today!</p>
<h2>Downloads</h2>
<ul>
<li><strong><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Jhc2ljIHNjYWxhIHdpY2tldC9zYW1wbGVzLnppcA==">Code samples</a></strong> (5.5 MB)
<ul>
<li>Simple HelloWorld Scala demo</li>
<li>Hello Wicket World demo (Scala and Wicket)</li>
<li>Hello Wicket World demo built with Maven</li>
</ul>
</li>
<li><strong><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Ftc3RlcmRhbSB3aWNrZXQgY29tbXVuaXR5IG1lZXR1cC93aWNrZXQgYW5kIHNjYWxhLnBkZg==">Slides</a></strong> (13.1 MB)</li>
</ul>
<p>The slides are also <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zbGlkZXNoYXJlLm5ldC9zdHVxL2Jhc2ljLXdpY2tldC1hbmQtc2NhbGE=">on slideshare</a>:</p>
<div id="__ss_1198018" style="width: 425px; text-align: left;"><a style=\"font: 14px Helvetica,Arial,Sans-serif; display: block; margin: 12px 0 3px 0; text-decoration: underline;\" title=\"Basic Wicket and Scala\" href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zbGlkZXNoYXJlLm5ldC9zdHVxL2Jhc2ljLXdpY2tldC1hbmQtc2NhbGE/dHlwZT1wcmVzZW50YXRpb24=">Basic Wicket and Scala</a><object style="margin: 0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=scalapresentation-amsterdam-090325152141-phpapp02&amp;rel=0&amp;stripped_title=basic-wicket-and-scala" /><param name="allowfullscreen" value="true" /><embed style="margin: 0px;" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=scalapresentation-amsterdam-090325152141-phpapp02&amp;rel=0&amp;stripped_title=basic-wicket-and-scala" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDMtMjQvYW1zdGVyZGFtLXdpY2tldC1tZWV0dXAtMjAwOQ==">Amsterdam Wicket meetup 2009</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=436" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009&amp;text=Amsterdam Wicket meetup 2009&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009&amp;t=Amsterdam Wicket meetup 2009">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009&amp;title=Amsterdam Wicket meetup 2009&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2009-03-24%2Famsterdam-wicket-meetup-2009&name=STUQ.nl&description=Amsterdam+Wicket+meetup+2009" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences' rel='bookmark' title='ApacheCon Europe 2009 community meetup experiences'>ApacheCon Europe 2009 community meetup experiences</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-27/london-wicket-meetup-wicket-1-5-wiquery-brix-and-more' rel='bookmark' title='London Wicket Meetup: Wicket 1.5, WiQuery, Brix and more..'>London Wicket Meetup: Wicket 1.5, WiQuery, Brix and more..</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download the Basic and Wicket Scala talk materials</title>
		<link>http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials</link>
		<comments>http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials#comments</comments>
		<pubDate>Wed, 04 Feb 2009 16:37:11 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=402</guid>
		<description><![CDATA[<span style="font-weight: normal;">On February 4th I gave a talk at <a href="http://jweekend.com/">the London Wicket User Group</a>. These are all the materials that you can download to get started with Scala and Wicket today!</span>

If you want to attend one of the Wicket User group meetings in London, just visit the <a href="http://jweekend.com">jWeekend site and register there</a>. It's really cool to attend, there is a good atmosphere and nice and smart people everywhere...

Click below to read the entire post and download everything!<p>Read the original at <a href="http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials">Download the Basic and Wicket Scala talk materials</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009' rel='bookmark' title='Amsterdam Wicket meetup 2009'>Amsterdam Wicket meetup 2009</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: normal;">On February 4th I gave a talk at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2p3ZWVrZW5kLmNvbS8=">the London Wicket User Group</a>. These are all the materials that you can download to get started with Scala and Wicket today!</span></p>
<p>If you want to attend one of the Wicket User group meetings in London, just visit the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2p3ZWVrZW5kLmNvbQ==">jWeekend site and register there</a>. It&#8217;s really cool to attend, there is a good atmosphere and nice and smart people everywhere&#8230;</p>
<h2>Downloads</h2>
<ul>
<li><strong><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Jhc2ljIHNjYWxhIHdpY2tldC9zYW1wbGVzLnppcA==">Code samples</a></strong> (5.5 MB)
<ul>
<li>Simple HelloWorld Scala demo</li>
<li>Hello Wicket World demo (Scala and Wicket)</li>
<li>Hello Wicket World demo built with Maven</li>
</ul>
</li>
<li><strong><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Jhc2ljIHNjYWxhIHdpY2tldC9oYW5kb3V0LnBkZg==">Handout</a></strong> (1.9 MB)</li>
<li><strong><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Jhc2ljIHNjYWxhIHdpY2tldC9iYXNpYyBzY2FsYSBhbmQgd2lja2V0LnBkZg==">Slides</a></strong> (16.1 MB)</li>
</ul>
<p>Or <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L2Rvd25sb2FkL2Jhc2ljIHNjYWxhIHdpY2tldC9CYXNpYyBTY2FsYSBhbmQgV2lja2V0IHRhbGsgbWF0ZXJpYWxzLnppcA==">download everything at once</a> (22.2 MB)</p>
<h2></h2>
<h2>Scala resources</h2>
<p>In this separate post you find links to Scala resources on the web (they are also in the slides, but this is much easier to click on).</p>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDItMDQvNi1zY2FsYS1yZXNvdXJjZXMtZm9yLWphdmEtcHJvZ3JhbW1lcnM=">6 Scala resources for Java programmers</a></p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDItMDQvZG93bmxvYWQtdGhlLWJhc2ljLWFuZC13aWNrZXQtc2NhbGEtdGFsay1tYXRlcmlhbHM=">Download the Basic and Wicket Scala talk materials</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=402" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials&amp;text=Download the Basic and Wicket Scala talk materials&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials&amp;t=Download the Basic and Wicket Scala talk materials">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials&amp;title=Download the Basic and Wicket Scala talk materials&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2009-02-04%2Fdownload-the-basic-and-wicket-scala-talk-materials&name=STUQ.nl&description=Download+the+Basic+and+Wicket+Scala+talk+materials" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-03-24/amsterdam-wicket-meetup-2009' rel='bookmark' title='Amsterdam Wicket meetup 2009'>Amsterdam Wicket meetup 2009</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>6 Scala resources for Java programmers</title>
		<link>http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers</link>
		<comments>http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers#comments</comments>
		<pubDate>Wed, 04 Feb 2009 16:31:03 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=378</guid>
		<description><![CDATA[During my Basic Scala and Wicket talk at the London Wicket Event I showed some good Scala starting points for Java programmers. Here they are, clickable and all.<p>Read the original at <a href="http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers">6 Scala resources for Java programmers</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala' rel='bookmark' title='Scala basics: What is Scala?'>Scala basics: What is Scala?</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>During my <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDItMDQvZG93bmxvYWQtdGhlLWJhc2ljLWFuZC13aWNrZXQtc2NhbGEtdGFsay1tYXRlcmlhbHM=">Basic Scala and Wicket talk at the London Wicket Event</a> I showed some good Scala starting points for Java programmers. Here they are, clickable and all.</p>
<p>If you want to attend one of the Wicket User group meetings in London, just visit the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2p3ZWVrZW5kLmNvbQ==">jWeekend site and register there</a>. It&#8217;s really cool to attend, there is a good atmosphere and nice and smart people everywhere&#8230;</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZw=="> <img class="alignnone size-thumbnail wp-image-384" title="Scala homepage" src="http://stuq.nl/media/scala_homepage-150x150.png" alt="Scala homepage" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZw==">Scala Homepage</a></p>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZw=="></a><strong>The Scala home on the web.</strong></p>
<p>Contains reference manuals, tutorials,<br />
news, specifications.</td>
</tr>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hcnRpbWEuY29tL3NjYWxhemluZS9hcnRpY2xlcy9zdGVwcy5odG1s"> <img class="alignnone size-thumbnail wp-image-385" title="First Steps to Scala" src="http://stuq.nl/media/first_steps_to_scala-150x150.png" alt="First Steps to Scala" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hcnRpbWEuY29tL3NjYWxhemluZS9hcnRpY2xlcy9zdGVwcy5odG1s">First steps to Scala</a></p>
<p><strong>When you don&#8217;t know anything about Scala, start here.</strong></p>
<p><span>Covers the interpreter, variables, methods, loops, arrays, lists, tuples, sets, maps, classes, singletons, traits, mixins.</span></td>
</tr>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jb2RlY29tbWl0LmNvbS9ibG9nL3NjYWxhL3JvdW5kdXAtc2NhbGEtZm9yLWphdmEtcmVmdWdlZXM="> <img class="alignnone size-thumbnail wp-image-386" title="roundup_for_java_refugees" src="http://stuq.nl/media/roundup_for_java_refugees-150x150.png" alt="roundup_for_java_refugees" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jb2RlY29tbWl0LmNvbS9ibG9nL3NjYWxhL3JvdW5kdXAtc2NhbGEtZm9yLWphdmEtcmVmdWdlZXM=">Scala for Java refugees</a></p>
<p><span><strong>Series of 6 great articles covering a lot of Scala.</strong></span></p>
<p><span>Aimed at Java developers.</span></td>
</tr>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NjYWxhLnN5Z25lY2EuY29t"> <img class="alignnone size-thumbnail wp-image-387" title="Scala Wiki" src="http://stuq.nl/media/scala_wiki-150x150.png" alt="Scala Wiki" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NjYWxhLnN5Z25lY2EuY29tLw==">Scala Wiki</a></p>
<p><strong>An ever growing collection of resources on Scala.</strong></p>
<p><span>FAQ, code samples, design patterns, Scala job openings</span></td>
</tr>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2dzLnN1bi5jb20vc3VuZGFyYXJhamFuL2VudHJ5L3NjYWxhX2Zvcl9qYXZhX3Byb2dyYW1tZXJz"> <img class="alignnone size-thumbnail wp-image-388" title="Scala for Java Programmers" src="http://stuq.nl/media/scala_for_java_programmers-150x150.png" alt="Scala for Java Programmers" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2dzLnN1bi5jb20vc3VuZGFyYXJhamFuL2VudHJ5L3NjYWxhX2Zvcl9qYXZhX3Byb2dyYW1tZXJz">Scala for Java programmers</a></p>
<p><span>Multiple articles covering a feature by feature comparison of Scala and Java.</span></td>
</tr>
<tr>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZy9ub2RlLzE5OQ=="> <img class="alignnone size-thumbnail wp-image-390" title="Mailing Lists" src="http://stuq.nl/media/mailing_lists-150x150.png" alt="Mailing Lists" width="150" height="150" /></a></td>
<td><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZy9ub2RlLzE5OQ==">Scala Mailing Lists</a></p>
<p><span><strong>Official mailing lists</strong></span></p>
<p><span>Subscribe: <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=c2NhbGEtc3Vic2NyaWJlQGxpc3Rlcy5lcGZsLmNo">empty message to scala-subscribe@listes.epfl.ch</a></span></td>
</tr>
</tbody>
</table>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDktMDItMDQvNi1zY2FsYS1yZXNvdXJjZXMtZm9yLWphdmEtcHJvZ3JhbW1lcnM=">6 Scala resources for Java programmers</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=378" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers&amp;text=6 Scala resources for Java programmers&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers&amp;t=6 Scala resources for Java programmers">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers&amp;title=6 Scala resources for Java programmers&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2009-02-04%2F6-scala-resources-for-java-programmers&name=STUQ.nl&description=6+Scala+resources+for+Java+programmers" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala' rel='bookmark' title='Scala basics: What is Scala?'>Scala basics: What is Scala?</a></li>
<li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>4 steps to add Scala to your Maven Java projects</title>
		<link>http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects</link>
		<comments>http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects#comments</comments>
		<pubDate>Wed, 26 Nov 2008 21:43:23 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=191</guid>
		<description><![CDATA[In this tutorial you learn how to integrate Scala in your existing Maven Java projects. From configuring the project's pom file to adding your first Scala code. <br/>Tip: Try to hide this inside a large code commit, and your co-workers will not notice you have added Scala support.. surprise!<p>Read the original at <a href="http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects">4 steps to add Scala to your Maven Java projects</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala' rel='bookmark' title='Scala basics: What is Scala?'>Scala basics: What is Scala?</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
<li><a href='http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences' rel='bookmark' title='ApacheCon Europe 2009 community meetup experiences'>ApacheCon Europe 2009 community meetup experiences</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvbWVkaWEvc2NhbGEtYW5kLW1hdmVuLWxvZ28ucG5n"><img style="float: left;" title="Scala" src="http://stuq.nl/media/scala-and-maven-logo-300x250.png" alt="Scala" width="210" height="175" /></a>In this tutorial you learn how to integrate Scala in your existing Maven Java projects. From configuring the project&#8217;s pom file to adding your first Scala code. Tip: Try to hide this inside a large code commit, and your co-workers will not notice you have added Scala support.. surprise!</p>
<h3>Step 1: Configure the Maven Scala Plugin in your pom.xml</h3>
<p>To building the Scala source code into Java bytecode, you can use the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NjYWxhLXRvb2xzLm9yZy9tdm5zaXRlcy9tYXZlbi1zY2FsYS1wbHVnaW4v">Maven Scala Plugin</a>.<br />
Add the <tt>&lt;plugins&gt;</tt> section somewhere in your <tt>pom.xml</tt> (in the <tt>&lt;build&gt;</tt> section):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.scala-tools<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-scala-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>testCompile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Alternative Step 1: Circular dependencies</h3>
<p><strong>Update: Do you need to build circular dependencies between Java and Scala? Put this in your pom.xml instead.</strong></p>
<p>Add the <tt>&lt;plugins&gt;</tt> section somewhere in your <tt>pom.xml</tt> (in the <tt>&lt;build&gt;</tt> section):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.scala-tools<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>maven-scala-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>test-compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>testCompile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>test-compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>process-resources<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>compile<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Step 2: Add Maven Scala Plugin repository</h3>
<p>Before the Maven Scala Plugin can be loaded, your Maven installation needs to know where to find the plugin and the other Scala dependencies. These items can be found in the <a title=\"Scala Tools repository\" href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NjYWxhLXRvb2xzLm9yZy9yZXBvLXJlbGVhc2VzLw==" target=\"_blank\">Scala Tools repository</a>. Add the following to your project-specific <tt>pom.xml</tt>. (You can also choose to add this repository to your <tt>~/.m2/settings.xml</tt>)</p>
<p>Add this to your <tt>pom.xml</tt> in the <tt>&lt;project&gt;</tt> section:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>scala<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Scala Tools<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://scala-tools.org/repo-releases/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>scala<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Scala Tools<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://scala-tools.org/repo-releases/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/releases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/snapshots<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Step 3: Add Scala dependency to your pom.xml</h3>
<p>Now that all Scala repositories and the Maven Scala plugin is configured, you can add the Scala dependency to your project&#8217;s <tt>pom.xml</tt>. Add the following code to the <tt>&gt;dependencies&gt;</tt> section of your <tt>pom.xml</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.scala-lang<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>scala-library<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.7.2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Step 4: Add some Scala code</h3>
<p>The Maven Scala plugin expects your Scala code in <strong><tt><PROJECT>/src/main/scala</tt></strong><br />
Create the <tt>scala</tt> directory.<br />
Put the following code in a file called <tt><PROJECT>/src/main/scala/<strong>demo.scala</strong></tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">object</span> HelloWorld <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> main<span style="color: #F78811;">&#40;</span>args<span style="color: #000080;">:</span> Array<span style="color: #F78811;">&#91;</span>String<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
    println<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;Hello, world!&quot;</span><span style="color: #F78811;">&#41;</span>
  <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<h3>Ready!</h3>
<p>You can now execute <tt>mvn package</tt> to build your project, <tt>mvn test</tt> to test your project, and the Scala class will get built. Let me know if you got it working, I&#8217;d love to hear your comments.</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDgtMTEtMjYvNC1zdGVwcy10by1hZGQtc2NhbGEtdG8teW91ci1tYXZlbi1qYXZhLXByb2plY3Rz">4 steps to add Scala to your Maven Java projects</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=191" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects&amp;text=4 steps to add Scala to your Maven Java projects&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects&amp;t=4 steps to add Scala to your Maven Java projects">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects&amp;title=4 steps to add Scala to your Maven Java projects&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2008-11-26%2F4-steps-to-add-scala-to-your-maven-java-projects&name=STUQ.nl&description=4+steps+to+add+Scala+to+your+Maven+Java+projects" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala' rel='bookmark' title='Scala basics: What is Scala?'>Scala basics: What is Scala?</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
<li><a href='http://stuq.nl/weblog/2009-04-03/apachecon-europe-2009-community-meetup-experiences' rel='bookmark' title='ApacheCon Europe 2009 community meetup experiences'>ApacheCon Europe 2009 community meetup experiences</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Scala basics: What is Scala?</title>
		<link>http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala</link>
		<comments>http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala#comments</comments>
		<pubDate>Mon, 24 Nov 2008 20:21:40 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://stuq.nl/?p=183</guid>
		<description><![CDATA[Many people do not know about the programming language Scala, or why they should care. I think you should care, because Scala has some nice secrets from which you can learn a lot. Scala is a great excuse for learning new things. Even if you never use Scala again, it can be a nice addition to any programmer's toolbox.

No matter what language you are programming in, it is a good habit to look at new developments. New ways of doing stuff keeps your brain alive. You become a better programmer with your existing tools. And maybe you get some new tools in the process.<p>Read the original at <a href="http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala">Scala basics: What is Scala?</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvbWVkaWEvc2NhbGEtd2VibG9nLXBvc3QucG5n"><img style="float: left;" title="Scala" src="http://stuq.nl/media/scala-weblog-post-300x250.png" alt="Scala" width="210" height="175" /></a></p>
<p>Many people do not know about the programming language Scala, or why they should care. I think you should care, because Scala has some nice secrets from which you can learn a lot. Scala is a great excuse for learning new things. Even if you never use Scala again, it can be a nice addition to any programmer&#8217;s toolbox.</p>
<p>No matter what language you are programming in, it is a good habit to look at new developments. New ways of doing stuff keeps your brain alive. You become a better programmer with your existing tools. And maybe you get some new tools in the process.</p>
<p>So, onto the first question, <strong>What is Scala?</strong></p>
<h3>What is Scala?</h3>
<p>Scala is a relatively young programming language. It has the following distinguishing features:</p>
<ul>
<li>Java compatible bytecode</li>
<li>Functional programming language</li>
</ul>
<h4>Java compatible bytecode</h4>
<p>Scala is a bit special because it runs on the Java virtual machine. This means that Scala code will compile into Java compatible bytecode. For the Java programmers, this means you can integrate Scala directly into your Java projects. This means that it is possible to create a Java interface and implement it in Scala. Or call Scala methods from Java. It also means that <strong>you can use a truckload of existing Java libraries with Scala</strong>.</p>
<p>This is very neat, as you do not have to convert entire projects to Scala. You can use Scala in the spots where it fits, and use Java as the main language. This makes Scala look a lot more interesting, especially in big Java shops.</p>
<h4>Functional programming language</h4>
<p>Scala is a functional programming language. To give a tip-of-the-iceberg-idea: <strong>every function is an object</strong>. Scala gives the possibility to pass values, but also to pass <strong>calculations</strong> to methods. This is very powerful and opens a lot of doors to all kinds of new programming constructs.</p>
<p>In Scala, you can make the following constructs very easily:</p>
<ul>
<li>Anonymous functions</li>
<li>Pass a function as argument to another function</li>
<li>Nested functions</li>
<li>Function as return value of a function</li>
</ul>
<h3>The Hello World example</h3>
<p>As any post about a new programming language, I cannot omit the Hello World example.</p>
<p>So, download Scala, copy/paste the following code and get started!</p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">object</span> HelloWorld <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> main<span style="color: #F78811;">&#40;</span>args<span style="color: #000080;">:</span> Array<span style="color: #F78811;">&#91;</span>String<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
    println<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;Hello, world!&quot;</span><span style="color: #F78811;">&#41;</span>
  <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<h3>Further reading</h3>
<ul>
<li><a title=\"The busy Java developers guide to Scala\" href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5pYm0uY29tL2RldmVsb3BlcndvcmtzL2phdmEvbGlicmFyeS9qLXNjYWxhMDEyMjguaHRtbA==" target=\"_blank\">The busy Java developers guide to Scala</a></li>
<li><a title=\"The Scala Programming Language\" href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zY2FsYS1sYW5nLm9yZy9ub2RlLzI1" target=\"_blank\">The Scala Programming Language</a></li>
</ul>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDgtMTEtMjQvc2NhbGEtYmFzaWNzLXdoYXQtaXMtc2NhbGE=">Scala basics: What is Scala?</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=183" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala&amp;text=Scala basics: What is Scala?&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala&amp;t=Scala basics: What is Scala?">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala&amp;title=Scala basics: What is Scala?&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2008-11-24%2Fscala-basics-what-is-scala&name=STUQ.nl&description=Scala+basics%3A+What+is+Scala%3F" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-11-26/4-steps-to-add-scala-to-your-maven-java-projects' rel='bookmark' title='4 steps to add Scala to your Maven Java projects'>4 steps to add Scala to your Maven Java projects</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/download-the-basic-and-wicket-scala-talk-materials' rel='bookmark' title='Download the Basic and Wicket Scala talk materials'>Download the Basic and Wicket Scala talk materials</a></li>
<li><a href='http://stuq.nl/weblog/2009-02-04/6-scala-resources-for-java-programmers' rel='bookmark' title='6 Scala resources for Java programmers'>6 Scala resources for Java programmers</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2008-11-24/scala-basics-what-is-scala/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>User friendly form validation with Wicket</title>
		<link>http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket</link>
		<comments>http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket#comments</comments>
		<pubDate>Wed, 03 Sep 2008 21:12:21 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket Tutorials]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>By default Wicket shows error messages together in a single place in the HTML form. This has some drawbacks to usability, especially if you have long forms with lots of fields. Read further for a tutorial exploring possibilities to improve the location of the error on the page, thereby improving usability.</p>
<p>Read the original at <a href="http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket">User friendly form validation with Wicket</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>By default Wicket shows error messages together in a single place in the HTML form. This has some drawbacks to usability, especially if you have long forms with lots of fields. Read further for a tutorial exploring possibilities to improve the location of the error on the page, thereby improving usability.</p>
<p>The default FeedbackPanel shows all errors in one place. When you enter a wrong value in an input field below the fold, the input field is a mile away from the error above the form. This makes it unclear which error message corresponds to which field.</p>
<p><img style="float: left;" src="http://stuq.nl/media/image/form-usability-scanning.png" border="0" alt="form-usability-scanning.png" height="242" /></p>
<p>The image on the left shows that a lot of page scanning is needed even with moderate sized forms.</p>
<p>With more than a few fields, the user is confused as which error corresponds to which field. It is a big problem when your e-commerce site scares away many potential clients who can&#8217;t complete your web forms!</p>
<h3 style="clear: both;">The default form</h3>
<p>Before I describe how to create a more user friendly form, first the &#8216;default&#8217; form. The following is an example of a standard Wicket form. This kind of form is the one you get without doing any &#8216;special&#8217; magic things. <strong>Place your mouse cursor over the image to see the default error messages above the form.</strong></p>
<p><img onmouseover="this.src='http://stuq.nl/media/image/form-usability-default-invalid.png'" onmouseout="this.src='http://stuq.nl/media/image/form-usability-default-valid.png'" src="http://stuq.nl/media/image/form-usability-default-valid.png" border="0" alt="Default Wicket form with FeedbackPanel at the top" height="150" /></p>
<p style="clear: both;">This form will be the starting point for our improvements.</p>
<h3>The improved form</h3>
<p>This is what we are going to make:</p>
<p><img src="http://stuq.nl/media/image/form-usability-tutorial-invalid.png" border="0" alt="Better and improved Wicket form with FeedbackLabels throughout" height="100" /></p>
<p style="clear: both;">As you can see, the error messages are directly next to the component that caused the error. This reduces the scanning of the page to link the error message to the right form component.</p>
<h3>Step 1: Introducing the FeedbackLabel</h3>
<p>The FeedbackLabel is a custom component I&#8217;ve written for this tutorial. With this custom label, you can show important feedback messages related to a FormComponent.</p>
<p>This has the advantage that you can place your Feedback messages in any place you want.</p>
<p>Add this to the Java part of the form:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// This shows feedback when the name input is not correct.</span>
FeedbackLabel nameFeedbackLabel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FeedbackLabel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name.feedback&quot;</span>, name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>nameFeedbackLabel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
FeedbackLabel colorFeedbackLabel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FeedbackLabel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;color.feedback&quot;</span>, color, customText<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>colorFeedbackLabel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Add another SPAN tag for every feedback label. You can place this near the relevant form component within the form.</p>
<h3>Step 2: Removing the FeedbackPanel completely? No, filtering!</h3>
<p>At first, it looks like you can remove the FeedbackPanel completely. But, then you will not be able to use the info() method to display text inside the FeedbackPanel! Therefore we need a way to filter the FeedbackMessages so error messages are not shown. I have written a FeedbackMessageFilter to accomplish that. It filters out the unwanted error messages.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// filteredErrorLevels will not be shown in the FeedbackPanel</span>
<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> filteredErrorLevels <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span>FeedbackMessage.<span style="color: #006633;">ERROR</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
feedback.<span style="color: #006633;">setFilter</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ErrorLevelsFeedbackMessageFilter<span style="color: #009900;">&#40;</span>filteredErrorLevels<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I have included the ErrorLevelsFeedbackMessageFilter in the project files, so you can reuse this in your existing projects. Remember if you use the error() method, you cannot use this filter! Instead, create your own filter that filters based on components.</p>
<h3>Step 3: Adding some style, the ComponentVisualErrorBehavior™</h3>
<p>I always love extremely long class names, like the <em>BookmarkablePageRequestTargetUrlCodingStrategy</em> or the <em>SharedResourceRequestTargetUrlCodingStrategy</em>. It makes my day to introduce a class name consisting of four words, the <strong>ComponentVisualErrorBehavior™</strong>.</p>
<p>This behavior changes the CSS styles for components that are invalid according to the Wicket form validation. You see in the screenshot that the textfield has a red line around it. This is the result of the ComponentVisualErrorBehavior. You can easily change the styles that are applied.</p>
<p><img src="http://stuq.nl/media/image/form-usability-tutorial-namefield.png" border="0" alt="form-usability-tutorial-namefield.png" width="358" height="48" /></p>
<p>To add the ComponentVisualErrorBehavior to your component, just add one line in your Java code:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">name.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ComponentVisualErrorBehavior<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;onblur&quot;</span>, nameFeedbackLabel<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8220;onblur&#8221; stands for the event that triggers this Behavior. The nameFeedbackLabel will also be updated when this is triggered, so that it will show the relevant error (or nothing if the input is valid).</p>
<h3>Download</h3>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvbWVkaWEvY29kZS9kZW1vLWZvcm1zLnppcA==">Download the complete example project</a> and start experimenting! (run with mvn jetty:run and connect to http://localhost:8080/demo)</p>
<p>Let me know how and where you use it in the comments!</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDgtMDktMDMvdXNlci1mcmllbmRseS1mb3JtLXZhbGlkYXRpb24td2l0aC13aWNrZXQ=">User friendly form validation with Wicket</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=77" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket&amp;text=User friendly form validation with Wicket&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket&amp;t=User friendly form validation with Wicket">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket&amp;title=User friendly form validation with Wicket&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2008-09-03%2Fuser-friendly-form-validation-with-wicket&name=STUQ.nl&description=User+friendly+form+validation+with+Wicket" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket/feed</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Create RESTful URLs with Wicket</title>
		<link>http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket</link>
		<comments>http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket#comments</comments>
		<pubDate>Fri, 20 Jun 2008 22:32:12 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket Tutorials]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<img style="float: right;" src="http://stuq.nl/media/image/wicket_logo.png" /><p>This is a tutorial on using Wicket with REST-style URLs. Normally, Wicket generates URLs that are a bit ugly. <br/>For example:<br/>
<i>http://www.example.com/wui/?wicket:bookmarkablePage=%3Anl.stuq.demo.SomePage</i>. </p><p>Uch!</p><p>RESTful URLs change that: they are more meaningful for the user, hide some of your implementation details, and are just beautiful. Plus, you're joining one of the latest hypes. Life couldn't be better...</p>
<p>Read the original at <a href="http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket">Create RESTful URLs with Wicket</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><img style="float: left;" src="http://stuq.nl/media/image/wicket_logo.png" alt="" /></p>
<p>This is a tutorial on using Wicket with REST-style URLs. Normally, Wicket generates URLs that are a bit ugly.<br />
For example:</p>
<p><em>http://www.example.com/wui/?wicket:bookmarkablePage=%3Anl.stuq.demo.SomePage</em>.</p>
<p>Ugly!</p>
<p>RESTful URLs change that: they are more meaningful for the user, hide some of your implementation details, and are just beautiful. Plus, you&#8217;re joining one of the latest hypes. Life couldn&#8217;t be better&#8230;</p>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL3NlYXJjaD9obD1lbiZhbXA7cT13aWNrZXQrcmVzdGZ1bCZhbXA7YnRuRz1Hb29nbGUrU2VhcmNo" target=\"_blank\">Looking around on the intertubes</a>, there is not much useful information about using RESTful URLs in Wicket. Because I need this for a project I&#8217;m currently working on, I decided to turn this into a small tutorial.</p>
<h3>What is REST?</h3>
<p><strong>Representational State Transfer (REST)</strong> is a software architectural style for distributed hypermedia systems like the world wide web. The best way to explain this, is an example. A REST application might define the following resources:</p>
<ul>
<li>http://example.com/users/</li>
<li>http://example.com/users/{user} (one for each user)</li>
<li>http://example.com/findUserForm</li>
<li>http://example.com/locations/</li>
<li>http://example.com/locations/{location} (one for each location)</li>
<li>http://example.com/findLocationForm</li>
</ul>
<p>This is a very, very short explanation of only a small part of what REST does. More information, as always, can be <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9SZXByZXNlbnRhdGlvbmFsX1N0YXRlX1RyYW5zZmVy" target=\"_blank\">found on Wikipedia</a>.</p>
<p>When you use custom URLs, you effectively hide some of your internal structure behind more meaningful URLs. This means you can refactor more easily without breaking external links or bookmarks to a specific part of your site. This is also important for search engine optimization.</p>
<p><strong>Note:</strong> I&#8217;m not going to describe here when you should or should not use REST<br />
with Wicket. That&#8217;s an architectural discussion, which depends greatly<br />
on your project. I have discovered some limitations in the Wicket development model that prevent the full implementation of REST. Please read further for more information.</p>
<h3>First steps</h3>
<p>I suggest you <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvbWVkaWEvY29kZS9kZW1vLXJlc3RmdWwuemlw">download the code</a> first and read along during the rest of this post.</p>
<p>We are going to create a customer overview page and a products overview page, reachable on &#8220;http://example.com/customers/&#8221; and &#8220;http://example.com/products/&#8221;.</p>
<p>The HomePage has two links, to the customer list and the product list. The product and customer lists have links to each individual product (http://example.com/products/${ID}) and customer (http://example.com/customers/${ID}).</p>
<p>For the Wicket UI, I created a HomePage, which links to the CustomerOverviewPage and ProductOverviewPage, which link to the Customer and Product detail pages. To serve up the data, we have some simple services, a ProductService and a CustomerService.</p>
<p><img style="clear: both;" src="http://stuq.nl/media/image/demo-urls-structure.png" alt="" /></p>
<h3>The code</h3>
<p>Wicket has a nice built in method of declaring (mounting) custom URL schemes. Simply give a class which implements the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aWNrZXRmcmFtZXdvcmsub3JnL2FwaWRvY3Mvd2lja2V0L3JlcXVlc3QvdGFyZ2V0L2NvZGluZy9JUmVxdWVzdFRhcmdldFVybENvZGluZ1N0cmF0ZWd5Lmh0bWw=" target=\"_blank\">IRequestTargetUrlCodingStrategy</a> interface to a WebApplication.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">void</span> mount<span style="color: #009900;">&#40;</span>IRequestTargetUrlCodingStrategy encoder<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Relatively new in Wicket is the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpY2tldC5hcGFjaGUub3JnL2FwaWRvY3MvMS40L29yZy9hcGFjaGUvd2lja2V0L3JlcXVlc3QvdGFyZ2V0L2NvZGluZy9NaXhlZFBhcmFtVXJsQ29kaW5nU3RyYXRlZ3kuaHRtbA==" target=\"_blank\">MixedParamUrlCodingStrategy</a>, which we will use in a minute.</p>
<p>This is an example of how to use the MixedParamUrlCodingStrategy in your WebApplication class:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">public</span> WicketApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
        MixedParamUrlCodingStrategy productURLS <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MixedParamUrlCodingStrategy<span style="color: #009900;">&#40;</span>
                <span style="color: #0000ff;">&quot;products&quot;</span>,
                ProductDetailPage.<span style="color: #000000; font-weight: bold;">class</span>,
                <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mount<span style="color: #009900;">&#40;</span>productURLS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This means:</p>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&quot;products&quot;</pre></div></div>

<p><em>This is the part of the URL after the Wicket&#8217;s application URL. In this case: &#8220;http://www.example.com/<strong>products</strong>&#8220;</em></li>
<li>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">ProductDetailPage.<span style="color: #000000; font-weight: bold;">class</span></pre></div></div>

<p><em>This defines for which class this URL is meant. In our project, the ProductDetailPage shows a product&#8217;s details.</em></li>
<li>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p><em>This is a list of all the parameters that you want to pass to this page. This shows up in the URL like this: &#8220;http://www.example.com/products/<strong>23</strong>&#8221; for a product with ID 23. You can easily pass more parameters to this page by adding items to this String array.</em></li>
<li>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">mount<span style="color: #009900;">&#40;</span>productURLS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><em>This passes this MixedParamUrlCodingStrategy to the WebApplication.</em></li>
</ul>
<h3>The Product detail page</h3>
<p>The ProductDetailPage receives these URL parameters in the following way:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> ProductDetailPage<span style="color: #009900;">&#40;</span>PageParameters parameters<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">int</span> id <span style="color: #339933;">=</span> parameters.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After that, you can get the Product with this ID (the rest of the code can be downloaded below):</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">setModel<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> CompoundPropertyModel<span style="color: #009900;">&#40;</span>productService.<span style="color: #006633;">getProduct</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Label</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Label</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BookmarkablePageLink<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;backLink&quot;</span>, getApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHomePage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Limitations of Wicket</h3>
<p>It is currently not possibly (without doing a workaround outside Wicket) to do HTTP PUT, DELETE and POSTs to arbitrary URLs. If you do know how to achieve this, you are very welcome to post it in the comments.</p>
<h3>Further steps</h3>
<p>In the above tutorial we configured the URL&#8217;s in the WebApplication init() method. This has the drawback that information about a single page is in muliple places. It is good from an architecture perspective to configure the URL&#8217;s from the Page itself. Look at the wicket-stuff annotation project for more information on how to do that. You can find <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpY2tldHN0dWZmLm9yZy9jb25mbHVlbmNlL2Rpc3BsYXkvU1RVRkZXSUtJL3dpY2tldHN0dWZmLWFubm90YXRpb24=" target=\"_blank\">an excellent tutorial</a> there. The wicketstuff-annotation library is used to mount your pages declaratively via Java annotations.</p>
<h3>Further reading</h3>
<ul>
<li>Putting more variables in a URL, AJAX resistent: <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpY2tldC5hcGFjaGUub3JnL2FwaWRvY3MvMS40L29yZy9hcGFjaGUvd2lja2V0L3JlcXVlc3QvdGFyZ2V0L2NvZGluZy9IeWJyaWRVcmxDb2RpbmdTdHJhdGVneS5QYWdlSW5mb0V4dHJhY3Rpb24uaHRtbA==" target=\"_blank\">HybridUrlCodingStrategy</a></li>
<li><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5tYWlsLWFyY2hpdmUuY29tL3dpY2tldC11c2VyQGxpc3RzLnNvdXJjZWZvcmdlLm5ldC9tc2czMDczMS5odG1s" target=\"_blank\">Wicket mailing list: Can I get a &#8216;Nice URL&#8217; when form validation fails?</a></li>
</ul>
<h3>Download</h3>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvbWVkaWEvY29kZS9kZW1vLXJlc3RmdWwuemlw">Download the complete example project</a> and start experimenting! (run with mvn jetty:run and connect to http://localhost:8080/demo)</p>
<p>Let me know how and where you use it in the comments!</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDgtMDYtMjAvY3JlYXRlLXJlc3RmdWwtdXJscy13aXRoLXdpY2tldA==">Create RESTful URLs with Wicket</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=72" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket&amp;text=Create RESTful URLs with Wicket&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket&amp;t=Create RESTful URLs with Wicket">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket&amp;title=Create RESTful URLs with Wicket&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2008-06-20%2Fcreate-restful-urls-with-wicket&name=STUQ.nl&description=Create+RESTful+URLs+with+Wicket" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup' rel='bookmark' title='Wicket: how to write a reusable modal window popup'>Wicket: how to write a reusable modal window popup</a></li>
<li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Wicket: how to write a reusable modal window popup</title>
		<link>http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup</link>
		<comments>http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup#comments</comments>
		<pubDate>Wed, 04 Jun 2008 23:22:47 +0000</pubDate>
		<dc:creator>Daan</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Wicket Tutorials]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Wicket is a Java framework for creating web frontends. It allows you to create a webpage in Java, combining all kinds of components into one page. <br/>
In many projects, a subset of user interface elements are repeated over the site. Depending on your project, you can have different selection panels or popups that are used multiple times.</p>

<p>In the following tutorial I describe a method to write your own application specific reusable modal window popup.</p>
<p>Read the original at <a href="http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup">Wicket: how to write a reusable modal window popup</a> or go to the homepage of <a href="http://stuq.nl">STUQ.nl</a></p>


<br/><br/>
Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Wicket is a Java framework for creating web frontends. It allows you to create a webpage in Java, combining all kinds of components into one page.</p>
<p>In many projects, a subset of user interface elements are repeated over the site. Depending on your project, you can have different selection panels or popups that are used multiple times.</p>
<p>In the following tutorial I describe a method to write your own application specific reusable modal window popup.</p>
<h3>Start!</h3>
<p>For this example, we use the <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aWNrZXRmcmFtZXdvcmsub3JnL3dpY2tldC1leHRlbnNpb25zL2FwaWRvY3Mvd2lja2V0L2V4dGVuc2lvbnMvYWpheC9tYXJrdXAvaHRtbC9tb2RhbC9Nb2RhbFdpbmRvdy5odG1s" target=\"_blank\">ModalWindow</a> component from <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3dpY2tldC5zb3VyY2Vmb3JnZS5uZXQvd2lja2V0LWV4dGVuc2lvbnMvaW5kZXguaHRtbA==" target=\"_blank\">Wicket Extensions</a>.If you don’t know what a ModalWindow looks like, you can <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aWNrZXQtbGlicmFyeS5jb20vd2lja2V0LWV4YW1wbGVzL2FqYXgvbW9kYWwtd2luZG93LjE=" target=\"_blank\">see a demo</a>. (hint: try to drag and drop it or resize it)</p>
<h3>The example from Wicket extensions</h3>
<p>The <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aWNrZXQtbGlicmFyeS5jb20vd2lja2V0LWV4YW1wbGVzL2FqYXgvbW9kYWwtd2luZG93LjE=" target=\"_blank\">default example from the Wicket Extensions site</a> contains no real reusable components, besides the ModalWindow itself. The Page inside the ModalWindow is tightly coupled to the ModalWindow. It closes its containing ModalWindow and sets a result parameter of the parent page. The components can only be reused in exactly the same way.</p>
<h3>How can we make this more reusable?</h3>
<p>We can make this more reusable by making the content of the ModalWindow not aware of the ModalWindow itself. The content does not know what will happen when the containing Form (or other data) is submitted. But how can we do that? The magic words are: <strong>abstract methods</strong>.</p>
<p><img style="float: right;" src="/media/image/demo-reusability-structure.jpg" alt="" />Before we start, you can <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L21lZGlhL2NvZGUvZGVtby1yZXVzYWJpbGl0eS56aXA=">download the code here</a>, so you can get the complete picture.</p>
<p>The image on the right contains the structure of the page and the components we are creating. The page contains a modal window, which in turn contains a content panel.</p>
<h3>The Content Panel</h3>
<p>Lets start with the content panel inside the ModalWindow popup. This panel contains a selection link, a selection button and a cancel button, created in the constructor:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> SelectContentPanel<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Create the form, to use later for the buttons</span>
  Form form <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Form<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;form&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  add<span style="color: #009900;">&#40;</span>form<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Add some example 'selection' methods, to show as example</span>
  <span style="color: #666666; font-style: italic;">// You can also use a full fledged form, I left that as an</span>
  <span style="color: #666666; font-style: italic;">// exercise for the reader :-)</span>
  add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxLink<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;selectionLink&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      onSelect<span style="color: #009900;">&#40;</span>target, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Selection using the link.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;selectionButton&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, Form form<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      onSelect<span style="color: #009900;">&#40;</span>target, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Selection using the button.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Add a cancel / close button.</span>
  form.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AjaxButton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onSubmit<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, Form form<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      onCancel<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>..<span style="color: #009900;">&#93;</span></pre></div></div>

<p>HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;a&gt;Select something&lt;/a&gt; 
&lt;form&gt;
&lt;input type=&quot;button&quot; value=&quot;Select something else&quot; /&gt;
&lt;input type=&quot;button&quot; value=&quot;Close&quot; /&gt;
  &lt;/form&gt;</pre></div></div>

<p>You probably noticed the calls to onSelect() and onCancel(). These are the abstract methods we are declaring:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> onCancel<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> onSelect<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, <span style="color: #003399;">String</span> selection<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>These methods are abstract, that way the code that is calling this panel must implement these methods. Because we are calling these methods, this effectively gives the result to the consuming code, without ever knowing what will happen with it.</p>
<p>To use abstract methods, the class itself must be abstract:<br />
public abstract class SelectContentPanel extends Panel</p>
<h3>The Modal Window</h3>
<p>The Modal Window initializes itself with some values. You can just as easily set these values from the calling class, but for now we keep it local.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> SelectModalWindow<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Set sizes of this ModalWindow. You can also do this from the HomePage</span>
    <span style="color: #666666; font-style: italic;">// but its not a bad idea to set some good default values.</span>
    setInitialWidth<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">450</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    setInitialHeight<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    setTitle<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Select something&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Set the content panel, implementing the abstract methods</span>
    setContent<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SelectContentPanel<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getContentId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">void</span> onCancel<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            SelectModalWindow.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">onCancel</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">void</span> onSelect<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, <span style="color: #003399;">String</span> selection<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            SelectModalWindow.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">onSelect</span><span style="color: #009900;">&#40;</span>target, selection<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;a&gt;Select something&lt;/a&gt; 
&lt;form&gt;
&lt;input type=&quot;button&quot; value=&quot;Select something else&quot; /&gt;
&lt;input type=&quot;button&quot; value=&quot;Close&quot; /&gt;
  &lt;/form&gt;</pre></div></div>

<p>The setContent() function call is interesting. Here we create a new SelectContentPanel and implement the methods onCancel() and onSelect(). It is possible to do some extra actions here, but here it is passed one-on-one to the abstract methods of the ModalWindow itself:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> onCancel<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> onSelect<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, <span style="color: #003399;">String</span> selection<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>The Home Page</h3>
<p>The Home Page itself can now instantiate the ModalWindow, override the methods and do something with the data. One big advantage is that you can see from the HomePage class directly what is going to happen after the user selects something or cancels the action:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">final</span> ModalWindow selectModalWindow <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SelectModalWindow<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;modalwindow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> onSelect<span style="color: #009900;">&#40;</span>AjaxRequestTarget target, <span style="color: #003399;">String</span> selection<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Handle Select action</span>
    resultLabel.<span style="color: #006633;">setModelObject</span><span style="color: #009900;">&#40;</span>selection<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    target.<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>resultLabel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    close<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">void</span> onCancel<span style="color: #009900;">&#40;</span>AjaxRequestTarget target<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Handle Cancel action</span>
    resultLabel.<span style="color: #006633;">setModelObject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ModalWindow cancelled.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    target.<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>resultLabel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    close<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
add<span style="color: #009900;">&#40;</span>selectModalWindow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Further customization</h3>
<p>This example is just passing a String around, you can change it to a more specific class. You can change the onSelect to something more appropriate for your use case. You can even put a Form inside the panel and return the resulting object of the form.</p>
<h3>Download</h3>
<p><a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L21lZGlhL2NvZGUvZGVtby1yZXVzYWJpbGl0eS56aXA=">Download the complete example project</a> and start experimenting!<br />
(run with mvn jetty:run and connect to http://localhost:8080/demo)</p>
<p>If you think this is useful, please let me know in the comments.</p>
<p>Read the original at <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmwvd2VibG9nLzIwMDgtMDYtMDUvd2lja2V0LWhvdy10by13cml0ZS1hLXJldXNhYmxlLW1vZGFsLXdpbmRvdy1wb3B1cA==">Wicket: how to write a reusable modal window popup</a> or go to the homepage of <a href="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0dXEubmw=">STUQ.nl</a></p>
 <img src="http://stuq.nl/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=68" width="1" height="1" style="display: none;" /><div id="simple_socialmedia"><ul class="ssm_row"><li class="sharetext">Share:</li><li class="twitter"><a target="_blank" href="http://twitter.com/share?url=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup&amp;text=Wicket: how to write a reusable modal window popup&amp;via=daanvanetten">Tweet</a></li><li class="facebook"><a target="_blank" title="Share on Facebook" rel="nofollow" href="http://www.facebook.com/sharer.php?u=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup&amp;t=Wicket: how to write a reusable modal window popup">Facebook</a></li><li class="linkedin"><a target="_blank" title="Share on LinkedIn" rel="nofollow" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup&amp;title=Wicket: how to write a reusable modal window popup&amp;source=STUQ.nl">LinkedIn</a></li><li class="tumblr"><a target="_blank" title="Share on Tumblr" rel="nofollow" href="http://www.tumblr.com/share/link?url=http%3A%2F%2Fstuq.nl%2Fweblog%2F2008-06-05%2Fwicket-how-to-write-a-reusable-modal-window-popup&name=STUQ.nl&description=Wicket%3A+how+to+write+a+reusable+modal+window+popup" title="Share on Tumblr">Tumblr</a></li><li class="stumble"><a target="_blank" title="Share on StumbleUpon" rel="nofollow" href="http://www.stumbleupon.com/submit?url=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup">Stumble</a></li><li class="digg"><a target="_blank" title="Share on Digg" rel="nofollow" href="http://www.digg.com/submit?phase=2&amp;url=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup">Digg</a></li><li class="delicious"><a target="_blank" title="Share on Delicious" rel="nofollow" href="http://del.icio.us/post?url=http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup&amp;title=INSERT_TITLE">Delicious</a></li></ul></div>

<br/><br/><p>Related posts:<ul><li><a href='http://stuq.nl/weblog/2009-11-01/automatically-test-your-wicket-panel-html-markup' rel='bookmark' title='Automatically test your Wicket panel HTML markup'>Automatically test your Wicket panel HTML markup</a></li>
<li><a href='http://stuq.nl/weblog/2008-06-20/create-restful-urls-with-wicket' rel='bookmark' title='Create RESTful URLs with Wicket'>Create RESTful URLs with Wicket</a></li>
<li><a href='http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket' rel='bookmark' title='User friendly form validation with Wicket'>User friendly form validation with Wicket</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://stuq.nl/weblog/2008-06-05/wicket-how-to-write-a-reusable-modal-window-popup/feed</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

