blob: db1b38d3723676fc76c9b5967daccdecc8a5ff38 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Apache Wicket - Apache Wicket releases Wicket 1.5</title>
<link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen" />
<!--[if lt ie 7]>
<link rel="stylesheet" href="/css/ie.css" type="text/css" media="screen" />
<![endif]-->
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="alternate" type="application/atom+xml" href="/atom.xml" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="container">
<div id="content">
<div id="header"><a href="/"><h1 id="logo"><span>Apache Wicket</span></h1></a></div>
<div id="navigation">
<h5><a name="Navigation-Wicket"></a>Meet Wicket</h5>
<ul>
<li>
<a href="/" title="Index">Home</a>
</li>
<li>
<a href="/meet/introduction.html" title="Introduction">Introduction</a>
</li>
<li>
<a href="/meet/features.html" title="Features">Features</a>
</li>
<li>
<a href="/meet/buzz.html" title="Buzz">Buzz</a>
</li>
<li>
<a href="/meet/vision.html" title="Vision">Vision</a>
</li>
<li>
<a href="/meet/blogs.html" title="Blogs">Blogs</a>
</li>
</ul>
<h5>
<a name="Navigation-GettingStarted" id="Navigation-GettingStarted"></a>Get Started
</h5>
<ul>
<li>
<a href="/start/download.html" title="Download Wicket">Download Wicket</a>
</li>
<li>
<a href="/start/quickstart.html" title="Getting started via a Maven Archetype">Quickstart</a>
</li>
<li>
<a href="http://www.jweekend.com/dev/LegUp" rel="nofollow">More archetypes</a>
</li>
<li>
<a href="/help" title="Get help">Get help</a>
</li>
<li>
<a href="/help/email.html" title="Wicket Mailing Lists">Mailing Lists</a>
</li>
</ul>
<h5>
<a name="Navigation-Documentation" id="Navigation-Documentation"></a>Learn
</h5>
<ul>
<li>
<a href="/start/userguide.html" title="User Guide">User Guide</a>
</li>
<li>
<a href="/learn/examples" title="Examples">Examples</a>
</li>
<li>
<a href="http://www.wicket-library.com/wicket-examples/compref/">Components</a>
</li>
<li>
<a href="/learn/projects/" title="Projects extending basic Wicket">Projects</a>
</li>
<li>
<a href="https://cwiki.apache.org/confluence/display/WICKET">Wiki</a>
</li>
<li>
<a href="https://cwiki.apache.org/confluence/display/WICKET/Reference+library">Reference guide</a>
</li>
<li>
<a href="/learn/books" title="Books">Books</a>
</li>
<li>
<a href="/learn/ides.html" title="IDEs">IDEs</a>
</li>
</ul>
<h5>
<a name="Navigation-Releases" id="Navigation-Releases"></a>Releases
</h5>
<ul>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/wicket/6.20.0">Wicket 6.20</a>
</li>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.5.13">Wicket 1.5</a>
</li>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.23">Wicket 1.4</a>
</li>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/wicket/1.3.7">Wicket 1.3</a>
</li>
<li>
<a href="http://wicket.sf.net/wicket-1.2" class="external-link" rel="nofollow">Wicket 1.2</a>
</li>
<li>
<a href="http://wicket.sf.net/wicket-1.1" class="external-link" rel="nofollow">Wicket 1.1</a>
</li>
<li>
<a href="http://wicket.sf.net/wicket-1.0" class="external-link" rel="nofollow">Wicket 1.0</a>
</li>
</ul>
<h5>
<a name="Navigation-Docs" id="Navigation-Docs"></a>API Docs
</h5>
<ul>
<li>
<a href="http://ci.apache.org/projects/wicket/apidocs/6.x/" title="JavaDocs of Apache Wicket 6.x">Wicket 6.x</a>
</li>
<li>
<a href="http://ci.apache.org/projects/wicket/apidocs/1.5.x/" title="JavaDocs of Apache Wicket 1.5.x">Wicket 1.5</a>
</li>
<li>
<a href="http://ci.apache.org/projects/wicket/apidocs/1.4.x" title="JavaDocs of Apache Wicket 1.4.x">Wicket 1.4</a>
</li>
<li>
<a href="http://ci.apache.org/projects/wicket/apidocs/1.3.x" title="JavaDocs of Apache Wicket 1.3.x">Wicket 1.3</a>
</li>
</ul>
<h5>Wicket 7.x</h5>
<ul>
<li>
<a href="http://www.apache.org/dyn/closer.cgi/wicket/7.0.0-M6">Download M6</a>
</li>
<li>
<a href="https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0">Migration guide</a>
</li>
<li>
<a href="http://ci.apache.org/projects/wicket/apidocs/7.x/" title="JavaDocs of Apache Wicket 7.x">API Docs 7.x</a>
</li>
</ul>
<h5>
<a name="Navigation-Developers" id="Navigation-Developers"></a>Contribute
</h5>
<ul>
<li>
<a href="/contribute/write.html" title="Writing documentation">Writing docs</a>
</li>
<li>
<a href="/contribute/build.html" title="Building from SVN">Build Wicket</a>
</li>
<li>
<a href="/contribute/patch.html" title="Provide a patch">Provide a patch</a>
</li>
<li>
<a href="/contribute/release.html" title="Release Wicket">Release Wicket</a>
</li>
<li>
<a href="https://fisheye6.atlassian.com/browse/wicket-git" title="Git Overview" class="external-link" rel="nofollow">Fisheye</a>
</li>
</ul>
<h5>
<a name="Navigation-Apache" id="Navigation-Apache"></a>Apache
</h5>
<ul>
<li>
<a href="http://www.apache.org/" class="external-link" rel="nofollow">Apache</a>
</li>
<li>
<a href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">License</a>
</li>
<li>
<a href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Sponsorship</a>
</li>
<li>
<a href="http://apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</a>
</li>
<li>
<a href="/apache/friends.html" title="Apache projects using Wicket">Friends</a>
</li>
</ul>
</div>
<div id="contentbody">
<h1>Apache Wicket releases Wicket 1.5</h1>
<p>The Apache Wicket team is proud to announce the immediate availability of the newest release of their component oriented open source Java web framework. Apache Wicket 1.5 has been in development for the last two years and brings many improvements over previous versions.</p>
<h2 id="downloading-apache-wicket-15">Downloading Apache Wicket 1.5</h2>
<p>You can download the release here: <a href="http://www.apache.org/dyn/closer.cgi/wicket/1.5.0">http://www.apache.org/dyn/closer.cgi/wicket/1.5.0</a></p>
<p>Or use this in your Maven POM to upgrade to the new version:</p>
<div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt">&lt;dependency&gt;</span>
<span class="nt">&lt;groupId&gt;</span>org.apache.wicket<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>wicket-core<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>1.5.0<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span></code></pre></div>
<p>Please note that Wicket’s main artifact ID has been renamed to <code>wicket-core</code>.</p>
<p>You will need to upgrade all modules (i.e. wicket, wicket-extensions, wicket-ioc, wicket-spring, etc) to 1.5.0. <strong>It is not possible to mix previous versions of Wicket with modules of this release.</strong></p>
<h2 id="most-notable-changes">Most notable changes</h2>
<p>With this release the Wicket team has revised many of its internals. A short list:</p>
<ul>
<li>HTML5 components added: <code>EmailTextField</code>, <code>NumberTextField</code>, <code>UrlTextField</code> and <code>RangeTextField</code></li>
<li>New inter-component events (explained below)</li>
<li>Minimum required servlet API is servlet-api 2.5</li>
<li>All standard validators now extend <code>Behavior</code> to allow for client side validations</li>
<li><code>IBehavior</code> has been removed and <code>AbstractBehavior</code> has been deprecated, you should now extend <code>Behavior</code> instead</li>
<li>Simplified the <a href="https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5">request cycle processing</a> and made it more extensible</li>
<li>URL handling is now in one place</li>
<li>Wicket’s rendering code has been greatly simplified</li>
<li>Improved browser <a href="https://cwiki.apache.org/confluence/display/WICKET/Caching+in+Wicket+1.5">caching support</a></li>
<li>ClientSideImageMap replaces old ImageMap</li>
<li>Better support for running behind proxies with <code>x-forwarded-for</code> header</li>
<li><a href="https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5">Request cycle listeners</a> make it easier to integrate frameworks in your Wicket application</li>
<li>Consistent naming: methods with <code>Javascript</code> in the name have been renamed to use proper capitalization: <code>JavaScript</code></li>
<li>Switching to HTTPS is as simple as configuring a new root mapper to make Wicket HTTPS aware and annotating a page with @RequireHttps</li>
</ul>
<p>A longer list of changes and improvements can be found in our <a href="http://s.apache.org/wicket-1.5-migration">migration guide</a>. </p>
<h3 id="inter-component-events">Inter-component events</h3>
<p>Wicket 1.5 offers a simple, yet flexible, way for component to communicate with each other in a decoupled manner. The two major interfaces that facilitate this are:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="cm">/**</span>
<span class="cm"> * Objects that can send events</span>
<span class="cm"> */</span>
<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">IEventSource</span> <span class="o">{</span>
<span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kt">void</span> <span class="nf">send</span><span class="o">(</span><span class="n">IEventSink</span> <span class="n">sink</span><span class="o">,</span> <span class="n">Broadcast</span> <span class="n">broadcast</span><span class="o">,</span> <span class="n">T</span> <span class="n">payload</span><span class="o">);</span>
<span class="o">}</span></code></pre></div>
<p>and</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="cm">/**</span>
<span class="cm"> * Objects that can receive events</span>
<span class="cm"> */</span>
<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">IEventSink</span>
<span class="o">{</span>
<span class="cm">/**</span>
<span class="cm"> * Called when an event is sent to this sink</span>
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">onEvent</span><span class="o">(</span><span class="n">IEvent</span><span class="o">&lt;?&gt;</span> <span class="n">event</span><span class="o">);</span>
<span class="o">}</span></code></pre></div>
<p>The classes that implement these interfaces, and can thus participate in the event mechanism are: <code>Component</code>, <code>RequestCycle</code>, <code>Session</code>, and <code>Application</code>.</p>
<p>The mechanism allows for different event broadcast methods defined here:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="cm">/**</span>
<span class="cm"> * Defines the event broadcast type.</span>
<span class="cm"> */</span>
<span class="kd">public</span> <span class="kd">enum</span> <span class="n">Broadcast</span> <span class="o">{</span>
<span class="n">BREADTH</span><span class="o">,</span>
<span class="n">DEPTH</span><span class="o">,</span>
<span class="n">BUBBLE</span><span class="o">,</span>
<span class="n">EXACT</span><span class="o">;</span>
<span class="o">}</span></code></pre></div>
<p>There is an example in wicket-examples which demonstrates the usage of this.</p>
<p>Applications can register custom event dispatchers in <code>FrameworkSettings</code>; the dispatchers can be used to build custom event delivery mechanisms. For example a custom <code>IEventDispatcher</code> mechanism can route events to annotated methods, for example:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyComponent</span> <span class="kd">extends</span> <span class="n">Component</span> <span class="o">{</span>
<span class="nd">@OnEvent</span>
<span class="kd">private</span> <span class="kt">void</span> <span class="nf">onUserAdded</span><span class="o">(</span><span class="n">UserAddedEvent</span> <span class="n">event</span><span class="o">)</span> <span class="o">{...}</span>
<span class="o">}</span></code></pre></div>
<p>where <code>UserAddedEvent</code> is the event payload object.</p>
<p>The default <code>Component#onEvent</code> method will be called even if custom dispatchers are registered.</p>
<p>A default event is raised whenever Wicket begins to create an AJAX response. The payload of the event is the <code>AjaxRequestTarget</code> used for event. Sample implementation:</p>
<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// component that always adds itself to the ajax response</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyComponent</span> <span class="kd">extends</span> <span class="n">Component</span> <span class="o">{</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onEvent</span><span class="o">(</span><span class="n">IEvent</span> <span class="n">event</span><span class="o">)</span> <span class="o">{</span>
<span class="k">if</span> <span class="o">(</span><span class="n">event</span><span class="o">.</span><span class="na">getPayload</span><span class="o">()</span> <span class="k">instanceof</span> <span class="n">AjaxRequestTarget</span><span class="o">)</span> <span class="o">{</span>
<span class="o">((</span><span class="n">AjaxRequestTarget</span><span class="o">)</span><span class="n">event</span><span class="o">.</span><span class="na">getPayload</span><span class="o">()).</span><span class="na">add</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">}</span></code></pre></div>
</div>
<div id="clearer"></div>
<div id="footer"><span>
Copyright &copy; 2015 &mdash; The Apache Software Foundation. Apache Wicket,
Wicket, Apache, the Apache feather logo, and the Apache Wicket project logo
are trademarks of The Apache Software Foundation. All other marks mentioned
may be trademarks or registered trademarks of their respective owners.
</span></div>
</div>
</div>
</body>
</html>