I recently used wicket to knock up a simple web shop example for our ExproRetail product and found it to be a fairly pleasant experience.
Wicket is (yet another) Java web framework but it distinguishes itself from many others with the following features:
Writing a Wicket app is rather more like writing an event-based desktop application than a web application. For example, to render a link and react when it’s clicked all that’s needed is:
In the template:
<a wicket:id="mylink">Click me</a>
In the code:
Similarly, to handle a form submission you could create a TextField, give it a model to read/write its data to and add it to a Form. In either case there is no need to worry about constructing specific URLs, query parameters, HTML escaping etc.
Templates are just standard XHTML with a sprinkling of wicket attributes. When Wicket renders the template and encounters a wicket:id it looks for a matching component to render the tagged element. This is a simple and powerful system very similar to that used by the Python web kit nevow.
Wicket also makes it very easy to create custom “widgets”: Simply extend from an appropriate subclass of Component and provide a snippet of XHTML (if needed). To use your widget, all that’s needed is a simple
With version 1.2 there’s lots of AJAXy goodness too but I’ve yet to try this myself and the docs seem to be slipping behind a little.
The downside to all this convenience, at least for any reasonably busy site, is that Wicket stores a lot of state in user sessions. Some of the time gained letting Wicket manage everything may be lost ensuring that session usage is kept under control.