The Apache Software Foundation released Apache Wicket 6.0, the latest version of its open-source Java Web app framework.
The Apache Software Foundation has
released version 6.0 of Apache
Wicket, an open-source component-based Java Web application framework.
Apache Wicket 6.0 is the latest
version of the Java component-oriented Web framework used by thousands of
development shops around the world, including an array of large and small
organizations such as Symantec, Walmart, Vegas.com, email provider GMX and the
Dutch Internal Revenue Service. Wicket eases the creation and maintenance of
complex Java Web applications. Version 6.0 enhances core functionality and
offers many new features, from OSGi compatibility to AJAX attributes to big data
support.
"This release delivers a
reinvigorated implementation of our client side API that enables developers to
integrate rich JavaScript libraries and components with minimal effort. We have
updated and broadened the capability and flexibility of many existing features
throughout the framework," said Martijn Dashorst, vice president of Apache
Wicket, in a statement.
Numerous enhancements make Apache
Wicket 6.0 a solid choice for Web development, including out-of-the box JQuery
integration, control over AJAX requests, improved event registration in
browsers, support for large data sets in components, dependency management for
client-side JavaScript libraries and experimental support for WebSockets.
Additional features include a
customizable client-side API, improved feedback messages, correct packaging for
OSGi compatibility and improved initialization of plug-ins.
Apache Wicket 6.0 requires Java 6.
This means that Wicket applications running on earlier Java versions meaning to
upgrade, also need to upgrade their Java runtime. Wicket's custom AJAX
JavaScript library has been re-implemented using JQuery. This makes it easier
to integrate JQuery plug-ins into Wicket applications. With the new AJAX
implementation, it is possible for developers to provide their own version of
JQuery should the need arise, or even to replace the whole Wicket client-side
AJAX implementation.
Also, with the new and improved AJAX
implementation, developers can alter any aspect of an AJAX request through
AjaxRequestAttributes. For example, you can specify that the request should be
executed using POST instead of GET, or that the AJAX request should be
multi-part, etc. See the migration guide or the JavaDoc of
AjaxRequestAttributes for all possible options.
In addition, browser event
registration replaces in-line events. Wicket now uses JavaScript event
registration instead of in-line attributes for AJAX components. This enables
multiple event listeners to be attached to a markup tag, cleans up the rendered
markup considerably and reduces the amount of generated markup. And the
IDataProvider now uses long instead of int. The IDataProvider<T>
interface and implementations now use long instead of int for index and size
parameters to better line up with the Java Persistence API and other
persistency frameworks. This means that big data is now possible with Wicket.
Another change in version 6.0 is
that ${label} replaces ${input} in feedback messages. Previous Wicket versions
used the input that was provided by users in error messages when validations
failed. This led to error messages like "1234a is not a valid number."
In Wicket 6 the feedback messages use the label of the invalid form component
instead. You can set the label by calling setLabel() on the form component. If
no label is provided, Wicket defaults to displaying the component identifier.
This changes the error message to "Phonenumber is not a valid
number."
With Wicket 6.0, it is now much
easier to create resource contributions with dependencies; for example, a
JQuery plug-in can declare a dependency on JQuery and other resources such as
embedded style sheets. Users of such resources don't have to provide these
dependencies themselves, and the dependencies are linked in the appropriate
order. And packaged resources will use the minimized version automatically.
When a minimized JavaScript resource is available (filename.min.js â add the
.min part to the filename before the extension), Wicket will automatically use
the minimized version when running in deployment mode, while using the non-minimized
version for development mode.
Regarding OSGi-compatible packaging,
Wicket's packaging has been made compatible with OSGi bundles by moving some
classes to different packages. The full list can be found in the migration
guide. This makes it much easier to deploy Wicket applications in an OSGi
environment. And regarding experimental WebSocket implementations, this release
also includes two experimental WebSocket implementations: one using Atmosphere
as a bridge for browsers and containers that don't support WebSockets natively,
and one for containers and browsers that have native WebSocket support.
The complete set of changes is available
in the migration guide.
Darryl K. Taft covers the development tools and developer-related issues beat from his office in Baltimore. He has more than 10 years of experience in the business and is always looking for the next scoop. Taft is a member of the Association for Computing Machinery (ACM) and was named 'one of the most active middleware reporters in the world' by The Middleware Co. He also has his own card in the 'Who's Who in Enterprise Java' deck.