blob: 38c978f4d8203331d2fae60b23f3cb6a48b16a8c [file] [log] [blame]
I"¡><div class="l-full l-first preamble">
<h1 id="introduction">Announcing Apache&nbsp;Wicket&nbsp;8: Write Less, Achieve More</h1>
<div>
<img src="/img/logo.svg" alt="Apache Wicket" width="200" height="200" />
</div>
<p>
The Apache Wicket project announces the 9th major release of the open source Java web framework servicing websites and applications across the globe since 2004. Built on top of Java 11, this version of Wicket brings web development into the modern Java world, offering a fundamental tool to keep you code up to date with Java evolution.
</p>
</div>
<div class="l-first">
<div class="l-full">
<h3>Bring the web into the modern Java era</h3>
<p>
The release of Java 9 has been a turning point in Java history which laid the foundation for the modern Java era. However, the magnitude of this change has discourage many developers from leaving the safe harbor rappresented by Java 8. With Wicket 9 we finally have a fundamental tool to move on and bring our web application into the new Java world.
</p>
<p>
With this version Wicket has been completed revisited and improved to embrace new technologies like Java modularization and new library like JUnit 5.
</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-half">
<h3>Stay up to date with Java release cycle</h3>
<p>
With Java releasing at a faster phase it's important to keep a library up to date with the lastest changes introduced in the platform and ensure it works with the latest Java release. Wicket does all of this by taking part to the [OpenJDK Quality Outreach](https://wiki.openjdk.java.net/display/quality/Quality+Outreach), an initiative aimed to test popular Open Source projects with both the latest OpenJDK release and the Early Access release.
</p>
</div>
<div class="l-half">
<h3> Be ready for the next Java Enterprise</h3>
<p>
Shortly after Java 9 was released, Oracle submitted Java EE to the Eclipse Foundation. As side effect of this owner change, the package name 'javax' had to be migrate to 'jakarta'. Wicket historically promoted decupling between Java EE APIs and application code, hence making much more easier the transition to the future Java Enterprise versions.
</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-two-third">
<h3>Lambdas in All The Right Places</h3>
<p>
The major feature of Java 8 was the addition of lambda support in the language. With Wicket 8 we have looked at providing lambda support in the API and have weighed it against performance and memory usage considerations.
</p>
<p>
In this light we have opted to continue using subclassing as the primary extension mechanism for Wicket components.
Factories for lambdas have been provided for various forms of models (databinding) and behaviors (adapters for components).
</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-full">
<h3>Optional is Sometimes Required</h3>
</div>
<div class="l-one-third">
<p>
The new Optional type in Java 8 is intended for places in your API where things can be null. In Wicket’s case we have adopted Optional in just those places to clarify the API.
</p>
<p>
For example the AjaxFallbackLink, a link that works using both with and without AJAX, now uses Optional to signify whether the link was clicked utilizing AJAX or normal request processing: the AJAX request is wrapped in an Optional. Previous versions of Wicket would provide a null value for the AJAX request.
</p>
<p>
Because we have modified the API to utilize Optional, you will get compile errors when you start migrating to Wicket 8. This gives you the exact positions where these improvements have occurred and you can start working with the Optional API.
</p>
</div>
<div class="l-two-third">
<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// WICKET 7:</span>
<span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">AjaxFallbackLink</span><span class="o">&lt;</span><span class="nc">Void</span><span class="o">&gt;(</span><span class="s">"wicket7"</span><span class="o">)</span> <span class="o">{</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onClick</span><span class="o">(</span><span class="nc">AjaxRequestTarget</span> <span class="n">target</span><span class="o">)</span> <span class="o">{</span>
<span class="k">if</span><span class="o">(</span><span class="n">target</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
<span class="c1">// ...</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">});</span>
<span class="c1">// WICKET 8:</span>
<span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">AjaxFallbackLink</span><span class="o">&lt;</span><span class="nc">Void</span><span class="o">&gt;(</span><span class="s">"wicket8"</span><span class="o">)</span> <span class="o">{</span>
<span class="nd">@Override</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onClick</span><span class="o">(</span><span class="nc">Optional</span><span class="o">&lt;</span><span class="nc">AjaxRequestTarget</span><span class="o">&gt;</span> <span class="n">target</span><span class="o">)</span> <span class="o">{</span>
<span class="k">if</span><span class="o">(</span><span class="n">target</span><span class="o">.</span><span class="na">isPresent</span><span class="o">())</span> <span class="o">{</span>
<span class="c1">// ...</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">});</span></code></pre></figure>
</div>
</div>
<div class="l-first l-flex">
<div class="l-full">
<h3>Models as Functional Interface</h3>
<p>
Wicket uses models as the databinding method: each data-aware component can take a model implementation to retrieve and store data in. From Wicket 8 we have made the root interface IModel a functional interface. You can now use lambdas where you can use models.
</p>
<p>
The following example binds a Label component to the name of a person object in different ways using Wicket 8:
</p>
<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">Label</span><span class="o">(</span><span class="s">"name1"</span><span class="o">,</span> <span class="nl">person:</span><span class="o">:</span><span class="n">name</span><span class="o">));</span>
<span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">Label</span><span class="o">(</span><span class="s">"name2"</span><span class="o">,</span> <span class="o">()</span> <span class="o">-&gt;</span> <span class="n">person</span><span class="o">.</span><span class="na">getName</span><span class="o">()));</span>
<span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">Label</span><span class="o">(</span><span class="s">"name3"</span><span class="o">,</span> <span class="nc">LambdaModel</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">personModel</span><span class="o">,</span> <span class="nl">Person:</span><span class="o">:</span><span class="n">getName</span><span class="o">)));</span>
<span class="n">add</span><span class="o">(</span><span class="k">new</span> <span class="nc">Label</span><span class="o">(</span><span class="s">"name4"</span><span class="o">,</span>
<span class="nc">LambdaModel</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">contractModel</span><span class="o">,</span> <span class="nl">Contract:</span><span class="o">:</span><span class="n">getPerson</span><span class="o">)</span>
<span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="nl">Person:</span><span class="o">:</span><span class="n">getName</span><span class="o">)));</span></code></pre></figure>
<p>
The new <code>LambdaModel</code> type in Wicket enables type safe, refactor safe databinding for components. Previously one would bind data to components using PropertyModel, using a string expression to determine the exact property to show. The string expression is something like <code>"person.name"</code>. This is inherently difficult to refactor when you decide to change the name field into for example <code>"lastName"</code>. With <code>LambdaModel</code>, this refactoring is trivial for IDEs to perform: the Java methods can easily be renamed and the IDE will find all the references.
</p>
<p>
Microbenchmarks have shown that using lambda models provides much better performance than the string based PropertyModel at the cost of slightly larger memory footprint.
</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-half">
<h3>No Rewrite Necessary</h3>
<p>
The Wicket team has been very careful of adopting Java 8 technologies and as such you don’t have to rewrite your whole application, whilst still reaping all the benefits of Java 8.
</p>
<p>
As this is a new major version we have, in accordance with semantic versioning, cleaned up many APIs and you will get compile errors when you migrate from previous Wicket versions.
</p>
</div>
<div class="l-half">
<h3>Migrating to Wicket 8</h3>
<p>
When you migrate from a previous Wicket version to Wicket 8, a full list of changes and migrations is available at the following page:
</p>
<p>
<a href="https://s.apache.org/wicket8migrate">https://s.apache.org/wicket8migrate</a>
</p>
<p>
Please consult this migration guide when you are moving towards Wicket 8.
</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-full">
<h2>Getting Started with Wicket 8</h2>
<p>
It is very easy to get started with Wicket: use our <a href="/start/quickstart.html">quick-start wizard</a> or
use one of the options below.
</p>
</div>
<div class="l-half">
<h3>Download using Apache Maven</h3>
<p>
With Apache Maven update your dependency to (and don't forget to
update any other dependencies on Wicket projects to the same version):
</p>
<figure 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>8.8.0<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/dependency&gt;</span></code></pre></figure>
</div>
<div class="l-half">
<h3>Download sources/binaries manually</h3>
<p>
Or download and build the distribution yourself, or use our
convenience binary package
</p>
<ul>
<li>Source: <a href="http://www.apache.org/dyn/closer.cgi/wicket/8.8.0">8.8.0 source download</a></li>
<li>Binary: <a href="http://www.apache.org/dyn/closer.cgi/wicket/8.8.0/binaries">8.8.0 binary download</a></li>
</ul>
</div>
</div>
<hr />
<div class="l-full l-first preamble">
<h1 id="introduction">Introducing Apache&nbsp;Wicket</h1>
<p>Invented in 2004, Wicket is one of the few survivors of the Java
serverside web framework wars of the mid 2000's. Wicket is an open
source, component oriented, serverside, Java web application framework.
With a history of over a decade, it is still going strong and has a
solid future ahead. Learn why you should consider Wicket for your next
web application.</p>
</div>
<div class="l-first l-flex">
<div class="l-one-third">
<img src="/img/java-wicket-html5.png" class="l-full" />
<h3>Just Java &amp; HTML</h3>
<p>Leverage what you know about Java or your favourite HTML
editor to write Wicket applications. With pure Java code and HTML
markup Wicket is the go-to web framework for purists.</p>
</div>
<div class="l-one-third">
<img src="/img/wicket-safe.png" class="l-full" />
<h3>Secure by Default</h3>
<p>URLs do not expose sensitive information and all component paths are
session-relative. Wicket keeps your model private except those parts
you explicitly expose.</p>
</div>
<div class="l-one-third">
<img src="/img/wicket-components.png" class="l-full" />
<h3>AJAX Components</h3>
<p>Write Ajax applications without having to write a single line
of JavaScript code. Wicket's Ajax functionality makes it trivial
to update selected parts of a UI, and comes with a great selection
of basic Ajax components.</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-one-third">
<h3>Open Source with Apache License</h3>
<p>Since its inception in 2004 Wicket has been an open source
project and remains available under one of the most permissive
licenses: the Apache Software License.</p>
</div>
<div class="l-one-third">
<h3>Maintainable code</h3>
<p>Pages and Components in Wicket are real Java objects that support
encapsulation, inheritance and events. Create high level components
with ease and bundle its stylesheets, JavaScript and other resources
into one reusable package.</p>
</div>
<div class="l-one-third">
<h3>Internationalized to take on the world</h3>
<p>With support of over 25 languages out-of-the-box, Wicket let's
you get started in your own language, or a second language with no
effort. You can provide alternative languages on the application,
page, or even component level.</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-one-third">
<h3>Multi-tab and window support</h3>
<p>No more pain while keeping taps on multiple tabs and windows.
Wicket's automatic state storage ensures that your users can open
pages in new tabs and windows without causing problems.</p>
</div>
<div class="l-two-third">
<h3>Work with JavaScript and CSS</h3>
<p>Global JavaScript libraries and CSS styling mix properly with
component local JavaScript and CSS resources. You can use custom
component libraries that ship with default JavaScript behaviour and
CSS styling, without having to do anything yourself. Creating such
self-contained component libraries is as easy as creating a JAR
file.</p>
</div>
</div>
<div class="l-first l-flex">
<div class="l-one-third">
<h3>Test your pages and components</h3>
<p>With WicketTester you can achieve testing coverage your QA
department can only dream of. Test your pages without having to run
inside a browser, or start a container. Test your components directly,
check their rendered markup tags, attributes and contents with ease.</p>
</div>
<div class="l-one-third">
<h3>Injection support</h3>
<p>Inject your services into your pages and components with the
technology of your choosing: Wicket provides integration with CDI
(JSR-305), Spring and Guice.</p>
</div>
<div class="l-one-third">
<h3>JavaEE integration</h3>
<p>If you are using the Web profile of JavaEE 6 or newer, you can
leverage JPA, EJBs, Bean Validation and CDI with Wicket's integrations
for these specifications.</p>
</div>
</div>
<div class="l-first">
</div>
<hr />
:ET