The Apache Wicket project has released version 1.4 of its open source, component oriented Java web application framework. This is their first release that requires Java 5 and above which allows for the use of Java 5 idioms like the generics which increase type safety of the APIs.
Athough there have been several notable changes in 1.4 it is mostly compatible with 1.3 so migrating your application to the latest release should be smooth:
From all the changes that went into this release, the following are the most important ones:
- Generified IModel interface and implementations increases type safety in your Wicket applications
- Component#getModel() and Component#setModel() have been renamed to getDefaultModel() and setDefaultModel() to better support generified models
- The Spring modules have been merged (wicket-spring-annot is now obsolete, all you need is wicket-spring)
- Many API's have been altered to better work with Java 5's idioms
- Wicket jars are now packaged with metadata that makes them OSGI bundles
You can download manually this release or get it with Maven:
<dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> <version>1.4.0</version> </dependency>
Arun Gupta reports on his experience upgrading to 1.4:
You may encounter the following error:
2009-08-05 05:58:49.387::INFO: No Transaction manager found - if your webapp requires one, please configure one. ERROR - DiskPageStore - Couldn't load DiskPageStore index from file /Users/arungupta/workspaces/runner~subversion/wicket/runner/target/work/wicket.runner-filestore/DiskPageStoreIndex. java.lang.ClassNotFoundException: org.apache.wicket.util.concurrent.ConcurrentHashMap at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:319)At least I did :)
Fortunately the fix is simple and intuitive. Instead of running "mvn jetty:run", invoke the command:
mvn clean jetty:run
Basically, "clean" will clean out references to older version of Wicket jars in your project and voila!
The Mystic Coders have also posted an upgrade to 1.4 guide for their original “5 Days of Wicket!” tutorial.
You can find more information about Wicket and other Frameworks right here on InfoQ!