Self-described as “…one of the few survivors of the Java serverside web framework wars of the mid 2000’s”, Apache Wicket announced its 8.0.0-M2 release yesterday.

“This release marks another milestone release of Wicket 8. We use semantic versioning for the development of Wicket. As this is pre-release software, API breaks are allowed between 7.x and 8, and between milestone releases.”

Apache Wicket

Apache Wicket has been open source since its inception in 2004 under the Apache Software license. It uses pure Java code and HTML markup: you can write AJAX components without touching JavaScript. However it also supports over 25 languages so you can use alternative languages at different levels (application, page, component level). It also integrates with JavaEE 6 or newer, and the latest release supports Java 8 classes.

It isn’t one of the most popular frameworks, or best known:

However it is relatively easy to get started without the need for too much xml. Also, after a long period of being badly documented, it now has extensive documentation.

Apache Wicket tries to overcome the limits of MVC framework: the conflict between a stateless HTTP protocol and the complex state that needs handling by the application. It does this by adopting a ‘component oriented’ web framework.

Component oriented web framework

Component oriented web frameworks attempt to abstract away the HTML request and response cycle and treat applications as collections of components. Instead of focusing on actions, items on a page such as text boxes are represented by components. These hide the low-level details.

The model of the requested page is built on the server, which generates HTML and sends it to the client. The web pages are objects, and HTML components are pure class instances. Thus the pages and components are stateful entities that can track user data, reference other objects and so on.

For example:

package org.wicketTutorial;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;
public class HomePage extends WebPage {	
    public HomePage() {
	add(new Label("helloMessage", "Hello WicketWorld!"));
    }
}

Produces the following HTML markup:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Apache Wicket HelloWorld</title>
	</head>
	<body>
		<div wicket:id="helloMessage">
		[Label's message goes here]
		</div>
	</body>
</html>

Wicket components have a lifecycle: initialisation, rendering and removing. Wicket instantiates the component and generates component markup. It is removed when explicitly removed from its component hierarchy, e.g. when its parent removes it.

What’s in this release

This release sees a large number of bug fixes and some improvements, such as default converters for Java 8 classes. It also has two new features: Custom Getters and Setters for PropertyResolver and PushBuilder API integration.

To update, follow the migration guidelines (if updating from an earlier version) and drop in the following to your pom.xml:

<dependency>
    <groupId>org.apache.wicket</groupId>
    <artifactId>wicket-core</artifactId>
    <version>8.0.0-M2</version>
</dependency>

Apache Wicket 8.0.0-M2

About The Author
- Katharine is a Java developer by trade, turned Community & Content Manager for Voxxed. Helping developers learn and share knowledge. Contact me at kbe@voxxed.com with any news, articles or tutorials.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>